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

rpc: Use MultiplexV2 for connections #7044

Merged
merged 2 commits into from
Feb 13, 2020
Merged

rpc: Use MultiplexV2 for connections #7044

merged 2 commits into from
Feb 13, 2020

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Jan 31, 2020

MultiplexV2 is a new connection multiplex header that supports multiplex both RPC and streaming requests over the same Yamux connection. This reduces the number of open connections between servers/clients.

MultiplexV2 was added in 0.8.0 as part of #3892 . So Nomad 0.11 can expect it to be supported. Though, some more rigorous testing is required before merging.

I want to call out some implementation details:

First, the current connection pool reuses the Yamux stream for multiple RPC calls, and doesn't close them until an error is encountered. This commit doesn't change it, and sets the RpcNomad byte only at stream creation.

Second, the StreamingRPC session gets closed by callers and cannot be reused. Every StreamingRPC opens a new Yamux session.

I did some basic testing, but I want to do more rigorous testing before merging it. Also, this seems like a change we should target a major release for? Nomad 0.11?

Closes #6878

@notnoop notnoop added this to the 0.11.0 milestone Jan 31, 2020
@notnoop notnoop self-assigned this Jan 31, 2020
MultiplexV2 is a new connection multiplex header that supports multiplex both
RPC and streaming requests over the same Yamux connection.

MultiplexV2 was added in 0.8.0 as part of
#3892 .  So Nomad 0.11 can expect it to
be supported.  Though, some more rigorous testing is required before merging
this.

I want to call out some implementation details:

First, the current connection pool reuses the Yamux stream for multiple RPC calls,
and doesn't close them until an error is encountered.  This commit doesn't
change it, and sets the `RpcNomad` byte only at stream creation.

Second, the StreamingRPC session gets closed by callers and cannot be reused.
Every StreamingRPC opens a new Yamux session.
helper/pool/pool.go Outdated Show resolved Hide resolved
Co-Authored-By: Michael Schurter <mschurter@hashicorp.com>
@notnoop
Copy link
Contributor Author

notnoop commented Feb 7, 2020

Thanks for the review - I'll merge when master is ready for 0.11.0 work.

@notnoop notnoop merged commit f6cf206 into master Feb 13, 2020
@notnoop notnoop deleted the f-use-multiplexv2 branch February 13, 2020 17:07
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Multiplex v2 protocol
3 participants