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

Add close-sessions-duration config key #827

Merged
merged 1 commit into from
Aug 8, 2021
Merged

Conversation

jcmoraisjr
Copy link
Owner

Active sessions of a stopping instance (haproxy -sf -x) are terminated just after hard-stop-after (our timeout-stop) times out and just before the old haproxy instance terminates. All the sessions at the same time. This option adds the ability to start the shutdown session at a configured time before the instance times out.

This is done on top of two new implementations: now sockets can be configured to leave the connection open, so we have a way to reach the stopping instance since its admin socket isn't being listened anymore (standalone/embedded only, we could reach an old instance using master/worker mode).

The other one is a new struct and associated funcs called connections, that holds the master socket (if used), admin sockets, a list of stopping instances, and also controls concurrent access. The instances list can be used by functionalities that need to read or change their state.

close-sessions-duration is built on top of them. A new goroutine starts when timeout - duration time has passed after the reload, and fairly distributes shutdowns along the remaining time of the instance.

Active sessions of a stopping instance (haproxy -sf -x) are terminated
just after hard-stop-after (our timeout-stop) times out and just before
the old haproxy instance terminates. All the sessions at the same time.
This option adds the ability to start the shutdown session at a
configured time before the instance times out.

This is done on top of two new implementations: now sockets can be
configured to leave the connection open, so we have a way to reach the
stopping instance since its admin socket isn't being listened anymore
(standalone/embedded only, we could reach an old instance using master/
worker mode).

The other one is a new struct and associated funcs called connections,
that holds the master socket (if used), admin sockets, a list of
stopping instances, and also controls concurrent access. The instances
list can be used by functionalities that need to read or change their
state.

close-sessions-duration is built on top of them. A new goroutine starts
when `timeout - duration` time has passed after the reload, and fairly
distributes shutdowns along the remaining time of the instance.
@jcmoraisjr jcmoraisjr merged commit 422e026 into master Aug 8, 2021
@jcmoraisjr jcmoraisjr deleted the jm-close-sessions branch August 8, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant