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

feat: Improve shutdown Delay default #615

Merged
merged 1 commit into from
May 4, 2023

Conversation

davinci26
Copy link
Contributor

When a baseplate server is shutting down in k8s

  • baseplate calls func (srv *Server) Shutdown(ctx context.Context) error which does the following:

  • Shutdown works by first closing all open listeners

  • k8s is attempting to remove the endpoint for the endpoints group and thus make (new) incoming traffic to the pod 0

This is a race condition because some callers are still trying to connect. We have empirically seen that the 5 second default is good enough for most services.

When a baseplate server is shutting down in k8s

* baseplate calls func (srv *Server) Shutdown(ctx context.Context) error
which does the following:
* Shutdown works by first closing all open listeners

* k8s is attempting to remove the endpoint for the endpoints group and thus
make (new) incoming traffic to the pod 0

This is a race condition because some callers are still trying to connect.
We have empirically seen that the 5 second default is good enough for
most services.

Signed-off-by: Sotiris Nanopoulos <[email protected]>
@davinci26 davinci26 requested a review from a team as a code owner May 4, 2023 03:00
@davinci26 davinci26 requested review from fishy, pacejackson and ghirsch-reddit and removed request for a team May 4, 2023 03:00
@kylelemons kylelemons merged commit b782bb3 into reddit:master May 4, 2023
davinci26 added a commit to davinci26/baseplate.py that referenced this pull request May 5, 2023
When a baseplate server is shutting down in k8s

* baseplate calls func (srv *Server) Shutdown(ctx context.Context) error which does the following:
* Shutdown works by first closing all open listeners

* k8s is attempting to remove the endpoint for the endpoints group and thus make (new) incoming traffic to the pod 0

This is a race condition because some callers are still trying to connect. We have empirically seen that the 5 second default is good enough for most services.

See also reddit/baseplate.go#615

Signed-off-by: Sotiris Nanopoulos <[email protected]>
chriskuehl pushed a commit to reddit/baseplate.py that referenced this pull request Apr 30, 2024
* feat: Improve shutdown Delay default

When a baseplate server is shutting down in k8s

* baseplate calls func (srv *Server) Shutdown(ctx context.Context) error which does the following:
* Shutdown works by first closing all open listeners

* k8s is attempting to remove the endpoint for the endpoints group and thus make (new) incoming traffic to the pod 0

This is a race condition because some callers are still trying to connect. We have empirically seen that the 5 second default is good enough for most services.

See also reddit/baseplate.go#615

Signed-off-by: Sotiris Nanopoulos <[email protected]>

* improve comment

Signed-off-by: Sotiris Nanopoulos <[email protected]>

---------

Signed-off-by: Sotiris Nanopoulos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants