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

Make shutdown timeout configurable #1806

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Make shutdown timeout configurable #1806

merged 1 commit into from
Jan 24, 2023

Conversation

jorng
Copy link
Contributor

@jorng jorng commented Nov 30, 2022

What is the problem I am trying to address?

Currently, when shutting down the server (via SIGINT), the shutdown closes any open connections after only 10 seconds (via a context.WithTimeout). This does not provie a lot of time for longer operations, such as listing versions, or downloading a larger module zip file.

When running in Kubernetes, and scaling instances or changing config, this causes a lot of dropped connections and gateway errors. 10 seconds is arguably much too short, and should be configurable.

How is the fix applied?

This commit increases that default to 60 seconds, and adds a config variable to allow users to specify their desired timeout.

@jorng jorng requested a review from a team as a code owner November 30, 2022 22:22
Copy link
Contributor

@nrwiersma nrwiersma left a comment

Choose a reason for hiding this comment

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

Just realised you have not updated a test. Could you also rebase the PR please.

Currently, when shutting down the server (via SIGINT or SIGTERM), the
shutdown closes any open connections after only 10 seconds (via a
context.WithTimeout). This does not provie a lot of time for longer
operations, such as listing versions, or downloading a larger module zip
file.

When running in Kubernetes, and scaling instances or changing config,
this causes a lot of dropped connections and gateway errors. 10 seconds
is arguably much too short, and should be configurable.

This commit increases that default to 60 seconds, and adds a config
variable to allow users to specify their desired timeout.
@jorng
Copy link
Contributor Author

jorng commented Jan 23, 2023

Rebased and fixed the failing test.

@jorng jorng requested a review from nrwiersma January 23, 2023 17:38
Copy link
Contributor

@nrwiersma nrwiersma left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@manugupt1
Copy link
Member

thanks!

@manugupt1 manugupt1 merged commit a155399 into gomods:main Jan 24, 2023
@jorng jorng deleted the shutdown-timeout branch January 25, 2023 02:09
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.

3 participants