-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
simplify pluginwatcher close by removing waitgroup #77892
Conversation
/retest |
/assign |
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.
/lgtm
/assign @yujuhong
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikedanese, yujuhong The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Overall is LGTM
return fmt.Errorf("failed to traverse plugin socket path %q, err: %v", w.path, err) | ||
} | ||
|
||
// Traverse deprecated plugin dir, if specified. | ||
if len(w.deprecatedPath) != 0 { | ||
if err := w.traversePluginDir(w.deprecatedPath); err != nil { | ||
w.Stop() | ||
w.fsWatcher.Close() |
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.
Why do not use w.Stop? w.stopped chan seems not be closed?
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.
if we call Stop here it will block until the time out. chans don't need to be closed unless something is waiting on them. stopped will go out of scope and be garbage collected. https://groups.google.com/forum/m/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
it is only necessary to close a channel if the receiver is
looking for a close. Closing the channel is a control signal on the
channel indicating that no more data follows.
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.
if we call Stop here it will block until the time out. chans don't need to be closed unless something is waiting on them. stopped will go out of scope and be garbage collected. https://groups.google.com/forum/m/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
it is only necessary to close a channel if the receiver is
looking for a close. Closing the channel is a control signal on the
channel indicating that no more data follows.
Thanks for your clarification!
/kind cleanup
/sig node