stream: only increase awaitDrain once for each pipe destination
Checklist
-
make -j4 test
(UNIX) orvcbuild test nosign
(Windows) passes -
a test and/or benchmark is included -
documentation is changed or added -
the commit message follows commit guidelines
Affected core subsystem(s)
stream
Description of change
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.
#7278 (closed)