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

Default shutdownQuietPeriod should be 0 or some fraction of the shutdownTimeout #2945

Closed
seabamirum opened this issue Jul 23, 2024 · 2 comments
Labels
type: enhancement A general enhancement

Comments

@seabamirum
Copy link

In DefaultLettuceClientConfiguration, the shutdownQuietPeriod is set as follows

this.shutdownQuietPeriod = shutdownQuietPeriod != null ? shutdownQuietPeriod : shutdownTimeout;

This effectively makes it so that clients who do not set this parameter in their LettuceClientConfiguration builder are forced to wait for the entire shutdownTimeout period before shutting down.

Proposed Solution
Modify the default value of shutdownQuietPeriod to be 0 or a fraction of the shutdownTimeout (e.g., 10% of shutdownTimeout). This change will ensure that the shutdown process is initiated promptly without waiting for the entire shutdownTimeout period.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 23, 2024
@mp911de
Copy link
Member

mp911de commented Jul 24, 2024

Shutdown timeouts are here to protect your application in a best-effort basis during shutdown. If your application shuts down cleanly without lagging Redis I/O during the shutdown, then you can set the timeouts to zero.

Shutdown timeouts have been a constant back and forth to find the ideal balance, shutdownQuietPeriod specifically was introduced with version 2.2 whereas LettuceClientConfiguration was added with version 2.0.

With Spring Data Redis introducing custom timeouts anyway, we could default the value to zero.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 24, 2024
@seabamirum
Copy link
Author

Thanks, I think that would be a good improvement. Until I found the shutdownQuietPeriod parameter, it took me a while to figure out why increasing shutdownTimeout only ended up increasing the actual shutdown time by the same amount. I had assumed there were active processes, etc. but this occurred even on an idle server.

@mp911de mp911de added this to the 3.3.3 (2024.0.3) milestone Aug 8, 2024
@mp911de mp911de changed the title Default shutdownQuietPeriod should be 0 or some fraction of the shutdownTimeout. Default shutdownQuietPeriod should be 0 or some fraction of the shutdownTimeout Aug 8, 2024
mp911de added a commit that referenced this issue Aug 8, 2024
Use a lower timeout for faster shutdown. Also, the quiet period is no longer configured through the shutdown timeout.

Closes #2945
@mp911de mp911de closed this as completed in 369b549 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants