Forgive me if my description for this issue is not clear enough. This is my first contribution and I am willing to spend time building a minimal reproduction environment for this issue, and fixing it in the future.
This issue happens when the following sequence of events occur:
- Transformer _flush function is called first upon the read stream being transformed ends.
- Passthrough stream
this[kStream] ends using this[kStream].end. The end function's callback is not called yet.
fileType.fromStream promise resolves and the .then function is called, setting this[kStream] = null
After this sequence, which happens randomly but frequently, this callback function for _transform, which is called in the callback function of this[kStream].end will not be called, leaving the transformer hanging.
I think something about setting the passthrough stream to null prevents it's end callback function from being called. I am still not sure what the exact reason for this is, so if you have any insight, please let me know. Thanks.
Forgive me if my description for this issue is not clear enough. This is my first contribution and I am willing to spend time building a minimal reproduction environment for this issue, and fixing it in the future.
This issue happens when the following sequence of events occur:
this[kStream]ends usingthis[kStream].end. The end function's callback is not called yet.fileType.fromStreampromise resolves and the.thenfunction is called, settingthis[kStream] = nullAfter this sequence, which happens randomly but frequently, this callback function for
_transform, which is called in the callback function ofthis[kStream].endwill not be called, leaving the transformer hanging.I think something about setting the passthrough stream to null prevents it's end callback function from being called. I am still not sure what the exact reason for this is, so if you have any insight, please let me know. Thanks.