-
Notifications
You must be signed in to change notification settings - Fork 436
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
Provide a context for managing the lifecycle of gRPC plugins #55
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.
LGTM
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.
Looks good.
client.go
Outdated
@@ -457,6 +462,8 @@ func (c *Client) Start() (addr net.Addr, err error) { | |||
|
|||
// Close the logging channel since that doesn't work on reattach | |||
close(c.doneLogging) | |||
// Cancel the context |
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.
Nitpick to add a blank line above here
If a plugin server goes away, gRPC clients will wait in the connecting and transient_failure states for some time (see https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md). This PR provides a context to the host process that will be canceled when go-plugin detects the plugin process has exited. If the host process detects the context has been closed it can take steps to recover.