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

multiple session legs support #158

Merged
merged 4 commits into from
Feb 28, 2024
Merged

multiple session legs support #158

merged 4 commits into from
Feb 28, 2024

Conversation

bobzilladev
Copy link
Contributor

Adding support for multiple session legs.

This adds two configuration options:

  • WithAdditionalServers(addrs []string)
  • WithMultiLeg(enable bool)

If multi-leg is enabled, then the ConnectAddresses in the Auth response of the first session are used to determine what additional sessions should be set up. The ReconnectingSession will accumulate more sessions on connect, then return as normal. ReconnectionSession will handle fan-out of calls to the underlying tunnel_client.Session as before, except now there are multiple of them.

If the first connection is made using least-latency, it will lock in to that ConnectAddress so reconnects will go back to the same region. Heartbeat callbacks are done for each underlying session, including appropriate region and latency information.

session.go Outdated Show resolved Hide resolved
session.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jrobsonchase jrobsonchase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! Some public API nits, but overall looks good 👍

session.go Outdated Show resolved Hide resolved
internal/tunnel/client/reconnecting.go Outdated Show resolved Hide resolved
session.go Show resolved Hide resolved
internal/tunnel/client/reconnecting.go Show resolved Hide resolved
session.go Show resolved Hide resolved
Copy link
Contributor

@jrobsonchase jrobsonchase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@bobzilladev bobzilladev merged commit f1d6f3c into main Feb 28, 2024
2 checks passed
@bobzilladev bobzilladev deleted the bob/muleg branch February 28, 2024 21:53
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

Successfully merging this pull request may close these issues.

4 participants