-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(vdev): do not terminate before child on SIGINT #22906
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
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 |
1720078 to
ffe54be
Compare
|
@pront I see you added a label to this. What can i do for this one? Imo its good to go in, it fixes the early termination I run into |
|
Hi @fbs, I appreciate the effort to reduce the need for manual intervention with |
|
Also, Vector supports a shutdown timeout, there might be opportunity to reduce the shutdown message flood though. |
|
. Could we do the std thing and let the parent forward the signal to the child? What do you mean by forwarding it? Both processes get the
I'll have a look at nix. I see its already in cargo.lock as dependency
Yes I do use that when I remember to put it in :) |
The SIGINT(control-c) is sent to both the parent and child, as they're in the same group. The
vdevprocess 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
killvector again, e.g.pkill vectorbut 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/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo nextest run --workspace(alternatively, you can runcargo test --all)./scripts/check_changelog_fragments.shgit merge origin masterandgit push.Cargo.lock), pleaserun
cargo vdev build licensesto regenerate the license inventory and commit the changes (if any). More details here.References