-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(vdev): do not terminate before child on SIGINT #22906
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
The SIGINT(control-c) is sent to both the parent and child, as they're in the same group. The `vdev` process quits immediately, as its just waiting on the child. However the child will go through its shutdown process, which by default takes a minute if it cannot cleanly shutdown. During this minute your controlling terminal gets flooded with shutdown messages. The way to stop it is to `kill` vector again, e.g. `pkill vector` but its annoying and could kill other vector instances. This lets the vdev ignore the SIGINT and just rely on the parent to terminate after the child did. Its currently only implemented on unix using the libc crate. Vector uses the nix crate, but that seemed a bit overkill for 2 lines.
Can you share an example of how you are using |
actually typing this out made me realized I miss one case: If you kill
To fix that vdev needs a signal handler that propagates signals to the child. Not sure thats worth the effort as afaik vdev is meant for interactive use |
The SIGINT(control-c) is sent to both the parent and child, as they're in the same group. The
vdev
process quits immediately, as its just waiting on the child. However the child will go through its shutdown process, which by default takes a minute if it cannot cleanly shutdown. During this minute your controlling terminal gets flooded with shutdown messages.The way to stop it is to
kill
vector again, e.g.pkill vector
but its annoying and could kill other vector instances.This lets the vdev ignore the SIGINT and just rely on the parent to terminate after the child did.
Its currently only implemented on unix using the libc crate. Vector uses the nix crate, but that seemed a bit overkill for 2 lines.
Summary
Change Type
Is this a breaking change?
How did you test this PR?
Tested in terminal.
Does this PR include user facing changes?
Notes
@vectordotdev/vector
to reach out to us regarding this PR.pre-push
hook, please see this template.cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)./scripts/check_changelog_fragments.sh
git merge origin master
andgit push
.Cargo.lock
), pleaserun
cargo vdev build licenses
to regenerate the license inventory and commit the changes (if any). More details here.References