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

Handling plugin crashes #31

Closed
paul-argeniss opened this issue Jul 13, 2017 · 1 comment
Closed

Handling plugin crashes #31

paul-argeniss opened this issue Jul 13, 2017 · 1 comment

Comments

@paul-argeniss
Copy link

Hello. I would like to know what is the recommended way of handling plugin crashes (i.e. the plugin process shutting down). I noticed go-plugin doesn't restart the process in this situation, so I was wondering if you are considering adding this feature, and if you are not then I would like to know the rationale behind that decision. Initially my idea was to verify the plugin status before any call, and start it if the process is down, but I wanted to check with you guys first in case I'm missing something. Thanks!

@mitchellh
Copy link
Contributor

Hey @paul-argeniss! We utilize the Ping method for this:

func (c *RPCClient) Ping() error {
Method calls in general will also start failing with errors.

So we usually take one of two approaches:

1.) Design our calls that are going to go over a plugin to expect an error can happen at any time (due to a plugin crashing) and handle that accordingly. This may involve creating a new client and relaunching the process.

2.) Call Ping() out of band at opportune times to determine if we need to restart a plugin.

It could be interesting to build in a restart mechanism into the Client itself, but existing plugin connections are going to be invalid going forward in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants