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

server: node connections must not be forwarded #7370

Merged
merged 2 commits into from
Mar 18, 2020

Commits on Mar 17, 2020

  1. server: node connections must not be forwarded

    This fixes a bug where a forwarded node update request may be assumed
    to be the actual direct client connection if the server just lost
    leadership.
    
    When a nomad non-leader server receives a Node.UpdateStatus request, it
    forwards the RPC request to the leader, and holds on the request
    Yamux connection in a cache to allow for server<->client forwarding.
    
    When the leader handles the request, it must differentiate between a
    forwarded connection vs the actual connection.  This is done in
    https://github.com/hashicorp/nomad/blob/v0.10.4/nomad/node_endpoint.go#L412
    
    Now, consider if the non-leader server forwards to the connection to a
    recently deposed nomad leader, which in turn forwards the RPC request to
    the new leader.
    
    Without this change, the deposed leader will mistake the forwarded
    connection for the actual client connection and cache it mapped to the
    client ID.  If the server attempts to connect to that client, it will
    attempt to start a connection/session to the other server instead and
    the call will hang forever.
    
    This change ensures that we only add node connection mapping if the
    request is not a forwarded request, regardless of circumstances.
    Mahmood Ali committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    429f531 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2020

  1. Protect against args being modified

    Mahmood Ali committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    63b8e45 View commit details
    Browse the repository at this point in the history