-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
There was a problem hiding this 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.
select { | ||
case <-c.flushCh: | ||
default: | ||
close(c.flushCh) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
||
func (c *circbufWriter) flushLoop() { | ||
// Check buffer every 100ms in case a flush from Write was missed | ||
ticker := time.NewTicker(time.Millisecond * 100) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
// 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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. |
No description provided.