-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib streams emitting data after end #2485
Comments
Cc @chrisdickinson? |
Could be related: #1668. |
It's a little confusing, but
Data isn't appearing after the Hopefully this clarifies what's going on in the above example! (I've omitted the manual |
Might be a bit confusing but seems like there is no real issue here. Maybe for transform streams register the callback to end() on the 'end' event? |
Hey,
I noticed that zlib streams still emit data (i.e in deflate stream, it writes the adler32 checksum) after .end() has been called.
Here is a test (with useful prints, obviously should be removed later) which fails on the recent 3.0.x:
(notice the data written after "deflate end cb")
I would really like to help fix this issue and it to be my first contribution here, so if anyone is willing to help with mentoring, that will be great.
From what I understand, calling end() triggers calling endWritable() which calls prefinish().
Transform's _flush() is registered to the prefinish event. Problem is, _flush() calls an async zlib Write(). Meanwhile, endWritable continues and calls end()'s callback.
Am I on to an issue?
Should zlib's _flush write synchronously if this is the last write?
The text was updated successfully, but these errors were encountered: