Skip to content

Writable Stream problem with end() callback #6868

@tysenmoore-xse

Description

@tysenmoore-xse

I am trying to close a writable stream using end() with a callback. However, when end() calls endWritable() and state.finished is set to false so the callback is set to trigger when the finish event triggers. The problem is the state.finished flag is only set within finishMaybe(). This routine is only called from endWritable() and afterWrite(). However, once end() is called you cannot write more data to the stream to trigger afterWrite() to make state.finished = true. It would seem that the end() callback only works when the state.finished is true.

I compared the 5.1.1 version of the code with the current master head within git. There have really been no changes to this area of the code.

My question is, How do I get the end() callback to work? Is there a problem in the code? If so, is there a workaround? (so far I don't see one) Thanks for the time and any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions