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 #785

Merged
merged 2 commits into from
Apr 30, 2024

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.

See also reddit/baseplate.go#615

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 <sotiris.nanopoulos@reddit.com>
@davinci26 davinci26 requested a review from a team as a code owner May 5, 2023 19:37
Signed-off-by: Sotiris Nanopoulos <sotiris.nanopoulos@reddit.com>
@davinci26
Copy link
Contributor Author

@bjk-reddit bjk-reddit requested review from chriskuehl and removed request for ghirsch-reddit April 8, 2024 13:06
Copy link
Contributor

@bjk-reddit bjk-reddit left a comment

Choose a reason for hiding this comment

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

This seems like a sensible default.

@bjk-reddit bjk-reddit added the v2.7 label Apr 8, 2024
@chriskuehl chriskuehl merged commit 84f985e into reddit:develop Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants