-
Notifications
You must be signed in to change notification settings - Fork 743
Fix complete_io()
for non-blocking IO
#2586
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2586 +/- ##
==========================================
+ Coverage 95.28% 95.31% +0.02%
==========================================
Files 97 97
Lines 21581 21591 +10
==========================================
+ Hits 20564 20580 +16
+ Misses 1017 1011 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is complex because it does too much (we should fix that)
I concur 😓
This function is complex because it does too much (we should fix that) but roughly either operates in "handshake" or "data" mode. The condition here is unreachable in "data" mode (thanks to the line above). In "handshake" mode IO flips between reading and writing rather than doing both at once, so it is rare that both reading and writing are attempted in one loop.
bcd96cb
to
ab1d978
Compare
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
fixes #2584 re #2559 re #2556
This introduces improved testing of
complete_io()
(tests which demonstrate the lack of progress bug reported in #2584) and then fixes it in two ways. It also fixes a case where the original issue would return(0, 0)
rather than the desired error.I don't much like
complete_io()
; it is doing way too much. But this PR is intended to apply cleanly onto rel-0.23, so I'll leave more significant changes to later.