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

shell: ignore SIGPIPE #6489

Merged
merged 2 commits into from
Dec 6, 2024
Merged

shell: ignore SIGPIPE #6489

merged 2 commits into from
Dec 6, 2024

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Dec 6, 2024

This PR fixes #6487 by ignoring SIGPIPE in the job shell.

At attempt at adding a test was made, but the test is inherently racy, because if the data is sent from the shell to the task before stdin is actually closed, the issue wouldn't reproduce (and also there's no way to synchronize on the job shell actually writing the data to the task, so the job could get canceled before any data is written) However, it seems sufficient for now.

Problem: If a task closes stdin and the job shell tries to write
data to it, the shell is immediately terminated with SIGPIPE, but it
would be better to handle an EPIPE error instead of terminating the
entire job.

Block SIGPIPE in the job shell.

Fixes flux-framework#6487
Problem: There's no test to ensure the job shell is not killed by
SIGPIPE when writing data to a task that has closed stdin.

Attempt to add a test for this issue. Add a note that the test is
inherently racy, and it is just a best effort at this time.
Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, LGTM!

@grondo
Copy link
Contributor Author

grondo commented Dec 6, 2024

Thanks! Setting MWP.

@mergify mergify bot merged commit 7cd6705 into flux-framework:master Dec 6, 2024
34 checks passed
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.61%. Comparing base (01c7e5c) to head (5fe12df).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6489      +/-   ##
==========================================
+ Coverage   83.58%   83.61%   +0.02%     
==========================================
  Files         524      524              
  Lines       87621    87623       +2     
==========================================
+ Hits        73240    73263      +23     
+ Misses      14381    14360      -21     
Files with missing lines Coverage Δ
src/shell/signals.c 95.23% <100.00%> (+0.50%) ⬆️

... and 17 files with indirect coverage changes

@grondo grondo deleted the issue#6487 branch December 6, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shell: turn fatal EPIPE error into warning
2 participants