hashicorp / go-plugin

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

Create ServeWithContext #134

Closed appilon closed 4 years ago

appilon commented 4 years ago

This feature allows a GRPC server to be manually cancelled via the context. This context does not override/get set as the root context of the GRPC Server so it can't be used for setting server-default metadata, it is currently only used for cancellation signalling. After the context cancels ServeWithContext still blocks until the server has completely exited.

A test case was written following the precedent set by the cleanup test, writing out a file proving to the TestCase the plugin closed as a result of manual cancellation.

appilon commented 4 years ago

Supporting this feature would be an antipattern after some discussion.