Repository navigation
Do not block signals for child processes - #11402
Merged
Merged
Conversation
…onger calls `pthread_sigmask` since 1.66
IanManske
marked this pull request as ready for review
January 12, 2024 15:42
Contributor
|
As discussed on discord. Thanks! |
Contributor
|
Thank you - this is a tricky area to get right and I really appreciate people working on it! |
dmatos2012
pushed a commit
to dmatos2012/nushell
that referenced
this pull request
Feb 20, 2024
# Description / User-Facing Changes Signals are no longer blocked for child processes launched from both interactive and non-interactive mode. The only exception is that `SIGTSTP`, `SIGTTIN`, and `SIGTTOU` remain blocked for child processes launched only from **interactive** mode. This is to help prevent nushell from getting into an unrecoverable state, since we don't support background jobs. Anyways, this fully fixes nushell#9026. # Other Notes - Needs Rust version `>= 1.66` for a fix in `std::process::Command::spawn`, but it looks our current Rust version is way above this. - Uses `sigaction` instead of `signal`, since the behavior of `signal` can apparently differ across systems. Also, the `sigaction` man page says: > The sigaction() function supersedes the signal() function, and should be used in preference. Additionally, using both `sigaction` and `signal` is not recommended. Since we were already using `sigaction` in some places (and possibly some of our dependencies as well), this PR replaces all usages of `signal`. # Tests Might want to wait for nushell#11178 for testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description / User-Facing Changes
Signals are no longer blocked for child processes launched from both interactive and non-interactive mode. The only exception is that
SIGTSTP,SIGTTIN, andSIGTTOUremain blocked for child processes launched only from interactive mode. This is to help prevent nushell from getting into an unrecoverable state, since we don't support background jobs. Anyways, this fully fixes #9026.Other Notes
Needs Rust version
>= 1.66for a fix instd::process::Command::spawn, but it looks our current Rust version is way above this.Uses
sigactioninstead ofsignal, since the behavior ofsignalcan apparently differ across systems. Also, thesigactionman page says:Additionally, using both
sigactionandsignalis not recommended. Since we were already usingsigactionin some places (and possibly some of our dependencies as well), this PR replaces all usages ofsignal.Tests
Might want to wait for #11178 for testing.