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

Think some more about SIGPIPE handling #12

Closed
unflxw opened this issue Nov 1, 2024 · 3 comments
Closed

Think some more about SIGPIPE handling #12

unflxw opened this issue Nov 1, 2024 · 3 comments
Labels

Comments

@unflxw
Copy link
Contributor

unflxw commented Nov 1, 2024

See also Slack monologue.

I'm not sure the current approach is right. I think we want is not the current reset_sigpipe reset, but #[unix_sigpipe = "inherit"], which is an experimental feature, available only on nightly.

Child processes will inherit whatever we set, and without #[unix_sigpipe = "inherit"], the child process will always have something (by default, "ignore") set on its behalf by the Rust standard library, so our options become:

Break the behaviour of some child processes when used in pipes (without reset_sigpipe)
Break the behaviour of some child processes when used in systemd (with reset_sigpipe)

I care a lot more about the systemd use case than about the pipes use case, so the options I’m considering are “remove reset_sigpipe” or “use a nightly toolchain”.

@backlog-helper
Copy link

backlog-helper bot commented Nov 1, 2024

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@unflxw unflxw changed the title Think some more about SIGPIPE handling Think some more about SIGPIPE handling Nov 1, 2024
@unflxw unflxw added the chore label Nov 4, 2024
@unflxw
Copy link
Contributor Author

unflxw commented Nov 5, 2024

For now, I think I'm going to remove reset_sigpipe, therefore restoring the Rust standard library's default behaviour, which is to ignore it, and not do any special handling of SIGPIPE -- that is, not forward it to the child process either, which will instead inherit the ignoring behaviour.

This seems preferable to the alternative.

unflxw added a commit that referenced this issue Nov 7, 2024
Remove `reset_sigpipe` and other code that handles `SIGPIPE` in any
way, such as ignoring it or forwarding it to the child process.

This restores the default behaviour of the Rust standard library,
which is to always ignore the signal. This behaviour will be inherited
by the child process.

See #12 for context.
@unflxw
Copy link
Contributor Author

unflxw commented Nov 7, 2024

Closing this for now -- #18 changes the application as described in the previous comment.

@unflxw unflxw closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant