Commit a08a017
stream: ensure awaitDrain is increased once
Guard against the call to write() inside pipe's ondata pushing more data
back onto the Readable, thus causing ondata to be called again.
This is fine but results in awaitDrain being increased more than once.
The problem with that is when the destination does drain, only a single
'drain' event is emitted, so awaitDrain in this case will never reach
zero and we end up with a permanently paused stream.
Fixes: #7278
PR-URL: #7292
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent b73ec46 commit a08a017Copy full SHA for a08a017
File tree
Expand file treeCollapse file tree
2 files changed
+36
-1
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+36
-1
lines changedOpen diff view settings
Collapse file
+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
530 | 530 | |
531 | 531 | |
532 | 532 | |
| 533 | + |
| 534 | + |
| 535 | + |
| 536 | + |
| 537 | + |
533 | 538 | |
534 | 539 | |
535 | 540 | |
| 541 | + |
536 | 542 | |
537 | | - |
| 543 | + |
538 | 544 | |
539 | 545 | |
540 | 546 | |
| ||
544 | 550 | |
545 | 551 | |
546 | 552 | |
| 553 | + |
547 | 554 | |
548 | 555 | |
549 | 556 | |
|
Collapse file
test/parallel/test-stream-pipe-await-drain-push-while-write.js
Copy file name to clipboard+28Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
0 commit comments