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: handle graceful shutdown #26197

Merged
merged 4 commits into from
Mar 31, 2025
Merged

feat: handle graceful shutdown #26197

merged 4 commits into from
Mar 31, 2025

Conversation

hiltontj
Copy link
Contributor

@hiltontj hiltontj commented Mar 28, 2025

Closes #26175

Provides a new crate influxdb3_shutdown which provides helpers for managing clean process shutdown.

  • wait_for_signal method that provides a system dependent future for waiting for a Ctrl+C signal
  • The ShutdownManager which is used to coordinate application shutdown.

This is currently only used in the WAL, where it triggers the WAL shutdown so that the buffer is flushed and responses to waiting requests are returned before exiting the process. Other components than the WAL that need to do cleanup before proper shutdown can utilize this feature.

Future work

The trigger_shutdown method can be used for #26161

provides basic wait methods for unix/windows OS's
@hiltontj hiltontj added the v3 label Mar 28, 2025
@hiltontj hiltontj self-assigned this Mar 28, 2025
Added rustdoc comments to types and methods in the influxdb3_shutdown
crate as well as a test that shows the ordering of a shutdown.
@hiltontj hiltontj marked this pull request as ready for review March 30, 2025 17:48
@hiltontj hiltontj requested a review from a team March 30, 2025 17:48
@hiltontj hiltontj merged commit 9401137 into main Mar 31, 2025
14 checks passed
@hiltontj hiltontj deleted the hiltontj/shutdown branch March 31, 2025 13:58
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.

Graceful shutdown mechanism
2 participants