Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Be able to provide custom yamux.Config to NewRPCClient #248

Open
mickmister opened this issue Apr 4, 2023 · 1 comment

Comments

@mickmister
Copy link

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.

go-plugin/rpc_client.go

Lines 64 to 66 in e889c1b

func NewRPCClient(conn io.ReadWriteCloser, plugins map[string]Plugin) (*RPCClient, error) {
// Create the yamux client so we can multiplex
mux, err := yamux.Client(conn, nil)

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?

@mickmister
Copy link
Author

Does anyone mind if I try to implement this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant