fix: stream protocols not completing #21733
Merged
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.
Description of Change
It's possible for NodeStreamLoader to receive the "end" event from the source stream while it's still writing to the network service. When that happens, it doesn't immediately clean itself up; instead it notes that the source stream is finished and waits for the write operation to complete. However, it wasn't correctly calling
NotifyComplete
when finishing the final write operation. This adds that call when appropriate.Fixes #21018. h/t to @pfrazee for the minimal repro which allowed me to track this down.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where custom stream protocols would sometimes not complete responses when the data stream ended.