fix(utils/stream): re-acquire writer lock when pipe() throws#4988
Open
Sriharsha-dev369 wants to merge 1 commit into
Open
fix(utils/stream): re-acquire writer lock when pipe() throws#4988Sriharsha-dev369 wants to merge 1 commit into
Sriharsha-dev369 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (60.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #4988 +/- ##
==========================================
- Coverage 78.89% 78.88% -0.02%
==========================================
Files 154 154
Lines 10566 10569 +3
Branches 2213 2213
==========================================
+ Hits 8336 8337 +1
- Misses 2230 2232 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
57e7bf7 to
ef01781
Compare
Author
|
Pushed an updated commit to fix the Codecov patch coverage — added a test covering the success path of finally. Could you approve the CI run? Thanks! |
ef01781 to
4ec478b
Compare
4ec478b to
8f766f1
Compare
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.
Fix: Writer lock not re-acquired after
pipeTo()failureProblem
pipe()callsreleaseLock()beforeawait pipeTo()but only re-acquiresthe writer on the success path. If
pipeTo()rejects (source error, clientdisconnect), the writer is left released and subsequent
write()/close()calls are silently lost.
Fix
pipeTo()intry/finallyso the writer is always re-acquiredpreventAbort: trueso the destination stays writable after a sourceerror — without it, the re-acquired writer targets an aborted stream and
writes are still dropped
Tests
The added tests assert that a
write()after a failedpipe()is delivered;they fail without either part of the fix.
Fixes #4981
Checklist
bun run format:fix && bun run lint:fix