-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(configurable shutdown duration): make shutdown duration configurable #17479
Changes from 7 commits
0e86389
691ef63
cf2d472
0d9fbcd
7975b08
ade867d
5517430
c62b218
15e2838
01ea738
495394a
181fa13
b42f79c
775cf31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#![allow(missing_docs)] | ||
use std::path::PathBuf; | ||
use std::{num::NonZeroU64, path::PathBuf}; | ||
|
||
use clap::{ArgAction, CommandFactory, FromArgMatches, Parser}; | ||
|
||
|
@@ -159,6 +159,26 @@ pub struct RootOpts { | |
)] | ||
pub internal_log_rate_limit: u64, | ||
|
||
/// Set the duration in seconds to wait for graceful shutdown after SIGINT or SIGTERM are received. | ||
/// After the duration has passed, Vector will force shutdown. | ||
#[arg( | ||
long, | ||
default_value = "60", | ||
env = "VECTOR_GRACEFUL_SHUTDOWN_DURATION", | ||
group = "graceful-shutdown-duration" | ||
)] | ||
pub graceful_shutdown_duration: NonZeroU64, | ||
|
||
/// Never time out while waiting for graceful shutdown after SIGINT or SIGTERM received. This is useful | ||
/// when you would like for Vector to attempt to send data until terminated by a SIGKILL. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we note here that this takes precedence over the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! FYI, If someone tries to use them both then vector fails to start: Comment updated here: c62b218 |
||
#[arg( | ||
long, | ||
default_value = "false", | ||
env = "VECTOR_NO_FORCED_SHUTDOWN", | ||
group = "graceful-shutdown-duration" | ||
)] | ||
pub no_forced_shutdown: bool, | ||
jszwedko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Set runtime allocation tracing | ||
#[cfg(feature = "allocation-tracing")] | ||
#[arg(long, env = "ALLOCATION_TRACING", default_value = "false")] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically we've suffixed time options with the unit they expect. In this case it'd be
graceful_shutdown_duration_secs
. Given that feels a bit repetitive, I'd suggestgraceful_shutdown_secs
. We have some documentation for this for configuration fields. We don't have similar documentation for flags, but I think applying the units suffix rules makes sense here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented a new name here, let me know if it looks good (we also want alignment internally): 15e2838