hashicorp / hashicorp/go-plugin

Plugin Graceful Shutdown

Open
#192 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
511
Avg merge
22h 47m
Merged PRs (30d)
4

Description

Hi! Thanks for such a great project.
I've a question. Running an app from `/examples/basic` right after successful plugin invocation the plugin it self fails due to a connection loss.
```
2022-04-10T04:24:36.480+0300 [DEBUG] plugin: starting plugin: path=./plugin/greeter args=[./plugin/greeter]
2022-04-10T04:24:36.483+0300 [DEBUG] plugin: plugin started: path=./plugin/greeter pid=83329
2022-04-10T04:24:36.483+0300 [DEBUG] plugin: waiting for RPC address: path=./plugin/greeter
2022-04-10T04:24:36.525+0300 [DEBUG] plugin.greeter: message from plugin: foo=bar timestamp=2022-04-10T04:24:36.524+0300
2022-04-10T04:24:36.526+0300 [DEBUG] plugin: using plugin: version=1
2022-04-10T04:24:36.526+0300 [DEBUG] plugin.greeter: plugin address: address=/var/folders/1p//*****************************T/plugin********* network=unix timestamp=2022-04-10T04:24:36.526+0300
2022-04-10T04:24:36.530+0300 [DEBUG] plugin.greeter: message from GreeterHello.Greet: timestamp=2022-04-10T04:24:36.530+0300
Hello!
2022-04-10T04:24:36.530+0300 [DEBUG] plugin.greeter: 2022/04/10 04:24:36 [ERR] plugin: plugin server: accept unix /var/folders/1p/*****************************T/plugin*********: use of closed network connection
2022-04-10T04:24:36.531+0300 [DEBUG] plugin: plugin process exited: path=./plugin/greeter pid=83329
2022-04-10T04:24:36.531+0300 [DEBUG] plugin: plugin exited
```

So is there any designed flow to gracefully shut down a plugin instance or should I just add some extra rpc call for that?

Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.