find: skip broken pipe errors in wasm executions - #802
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #802 +/- ##
==========================================
+ Coverage 91.90% 91.93% +0.03%
==========================================
Files 35 35
Lines 7248 7251 +3
Branches 376 378 +2
==========================================
+ Hits 6661 6666 +5
+ Misses 444 443 -1
+ Partials 143 142 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Commit 18052b1 has test result changes: bfs testsuite: |
Contributor
|
could you please add a test to make sure it doesn't regress ? |
flush() only checked for BrokenPipe, silently ignoring other errors (e.g. ENOSPC). Add regression tests for both cases.
Contributor
Author
I've tried fixing the new test failures from the bfs test suite. Also added the regression tests. Let me know if it is good to go. |
|
Commit 965d734 has test result changes: bfs testsuite: |
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.
Fixes #801.
out.flush().unwrap()inPrinter::printpanics when stdout is aclosed pipe (e.g.
find . | head -5), since the flush fails withEPIPE. Only visible on wasm32-wasip1: there's no SIGPIPE there, sothe write error reaches this
unwrap()and panics. On native Linuxthe same unguarded
unwrap()exists, but SIGPIPE usually kills theprocess before this code runs, so the bug goes unnoticed.
Treat
io::ErrorKind::BrokenPipeonwrite!/flush()as expectedand exit 0, instead of panicking.