Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaked executor in raw_exec #5248

Merged
merged 7 commits into from
Jan 29, 2019
Merged

Fix leaked executor in raw_exec #5248

merged 7 commits into from
Jan 29, 2019

Conversation

nickethier
Copy link
Member

No description provided.

Copy link
Contributor

@notnoop notnoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside of `circbufWriter, the changes look to good to me, but another review as I don't necessarily have the context for all the details.

command/executor_plugin.go Outdated Show resolved Hide resolved
command/executor_plugin.go Outdated Show resolved Hide resolved
command/executor_plugin.go Outdated Show resolved Hide resolved
command/executor_plugin.go Outdated Show resolved Hide resolved
command/executor_plugin.go Outdated Show resolved Hide resolved
command/executor_plugin.go Outdated Show resolved Hide resolved
lib/circbufwriter/writer.go Show resolved Hide resolved
select {
case <-c.flushCh:
default:
close(c.flushCh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a neat pattern, didn't know of it before

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use with care! It does not support concurrent callers without extra coordination.

lib/circbufwriter/writer.go Show resolved Hide resolved

func (c *circbufWriter) flushLoop() {
// Check buffer every 100ms in case a flush from Write was missed
ticker := time.NewTicker(time.Millisecond * 100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to defer ticker.Stop() here well. Not sure how ticker works if not stopped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we always use timer and manually reset the timer which I was missing before. I may switch back to that as its a little more obvious

@nickethier nickethier merged commit 14c5a1c into master Jan 29, 2019
@nickethier nickethier deleted the b-rawexec-leak branch January 29, 2019 02:58
// circleBufferSize is the size of the in memory ring buffer used for
// go-plugin logging to stderr. When the buffer exceeds this size before
// flushing it will begin overwriting data
circleBufferSize = 64 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this size related to #4765 for example? we log up to 200kb log lines in some cases

Copy link
Member Author

@nickethier nickethier Jan 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! This is for the logs of the executor itself, whats found in executor.out. We're piping these logs up to the Nomad client's logger. Completely different path than task logs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks for clarifying @nickethier

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants