In order to use a debugger while developing a plugin, I need to modify the below code to allow for the RPC connection's timeout to tolerate the amount of time the debugger is paused. Before making this change, the plugin gets disconnected due to the failing timeout.
func NewRPCClient(conn io.ReadWriteCloser, plugins map[string]Plugin) (*RPCClient, error) {
sessionConfig := yamux.DefaultConfig()
sessionConfig.EnableKeepAlive = true
sessionConfig.ConnectionWriteTimeout = time.Minute * 5
// Create the yamux client so we can multiplex
mux, err := yamux.Client(conn, sessionConfig)
I'd like to be able to provide a value to this function, in order to allow for customizing the yamux.Config used here. I'd like to make the change to make this configurable, possibly by environment variables if that's the most appropriate way. Any advice on how this change should be done?
In order to use a debugger while developing a plugin, I need to modify the below code to allow for the RPC connection's timeout to tolerate the amount of time the debugger is paused. Before making this change, the plugin gets disconnected due to the failing timeout.
https://github.com/hashicorp/go-plugin/blob/e889c1ba1044d1b183d4ed45d0f2f531db3ba50b/rpc_client.go#L64-L66
I'd like to be able to provide a value to this function, in order to allow for customizing the
yamux.Config
used here. I'd like to make the change to make this configurable, possibly by environment variables if that's the most appropriate way. Any advice on how this change should be done?