hashicorp / go-plugin

Golang plugin system over RPC.
Mozilla Public License 2.0
5.25k stars 450 forks source link

plugin process exited error="signal: terminated" #203

Open hiyosi opened 2 years ago

hiyosi commented 2 years ago

If the parent process is managed by the systemd and the default KillSignal=SIGTERM and KillMode=control-group are set, the signal SIGTERM is also sent to the child process.

And, I found the server code does not handle SIGTERM, so it shutdown abnormally. https://github.com/hashicorp/go-plugin/blob/v1.4.4/server.go#L432

Should it handle not only Interrupt but other signals(e.g.SIGTERM)? Or It can not shut down the plugin properly in case of above? It must be kill with KillMode=process ?

Regarding the log level. Prior to v1.4.3, the message logged as debug level. In v1.4.4, log level has been changed to error. https://github.com/hashicorp/go-plugin/blob/v1.4.4/client.go#L638-L640