Skip to content

Flush callback not called., causing the Transform stream to hang #8

@AhmedAlSaey

Description

@AhmedAlSaey

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:

  1. Transformer _flush function is called first upon the read stream being transformed ends.
  2. Passthrough stream this[kStream] ends using this[kStream].end. The end function's callback is not called yet.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions