iemejia commented on code in PR #3875:
URL: https://github.com/apache/avro/pull/3875#discussion_r3570359299


##########
lang/js/lib/files.js:
##########
@@ -213,6 +233,9 @@ BlockDecoder.prototype._write = function (chunk, encoding, 
cb) {
   tap.pos = 0;
 
   if (!this._decodeHeader()) {
+    if (this._errored) {
+      return; // Destroyed while decoding the header; leave the write callback.
+    }
     process.nextTick(cb);
     return;
   }

Review Comment:
   Fixed in 8dde40a: the fatal-header path in `_write` now calls 
`process.nextTick(cb)` before returning (and the analogous `_errored` 
early-return in `_writeChunk` does too), so the write callback is always 
released and upstream writers/pipelines are not left stalled mid-write when the 
stream is destroyed. Added a white-box regression test that fails by timeout if 
the callback is left pending.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to