hashicorp / go-plugin

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

Support custom yamux.Config #205

Open mickmister opened 2 years ago

mickmister commented 2 years ago

When using the dlv debugger, the plugin's RPC call will be terminated while the debugger is paused. I have gotten around this by making this change in

https://github.com/hashicorp/go-plugin/blob/a02e5c7a911db823ae167d00bc1024f99d340258/rpc_client.go#L63

-   mux, err := yamux.Client(conn, nil)
+   sessionConfig := yamux.DefaultConfig()
+   sessionConfig.EnableKeepAlive = true
+   sessionConfig.ConnectionWriteTimeout = time.Minute * 5
+   mux, err := yamux.Client(conn, sessionConfig)

Is it possible to allow for a config like this, or an alternative way to avoid having the RPC connection be interrupted?