-
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
Stream.Writable reports wrong number in _writableState.bufferedRequestCount #6758
Comments
@nodejs/streams |
Since I'm the troublemaker here, let me try to give it a go. |
@andrey-makhnutin I reopened that PR, if you needed that open. |
The bug itself is not difficult to fix (have a look at #6761). That PR just needs a test, so it is a awesome good first contribution! |
I'd like to give it a go, this is my first time contributing thought, so It'll take a while to get used to the workflow. It seems the fix itself is already on a pull request (but the pull request is closed), should I make a pull request with the same change but adding tests? Or is the fix wrong and should I also look into how to fix it properly (comment above me suggests it works fine, but I'd like to make sure) |
@jlvivero the fix should be fine as it and it only needs a test. Ideally you could cherry-pick the commit and add a test on top of that or you just do the same change on your own and add a test. |
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js Fixes: nodejs#6758
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: #15661 Fixes: #6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: #15661 Fixes: #6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: nodejs/node#15661 Fixes: nodejs/node#6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: #15661 Fixes: #6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: #15661 Fixes: #6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This changes the disparity of bufferedRequestCount and the actual buffer on file _stream_writable.js PR-URL: #15661 Fixes: #6758 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Was casually reading _stream_writable.js and noticed that
clearBuffer()
mistakenly zeroesstate.bufferedRequestCount
at the end of the function in case when_writev
is not implemented and_write
is not synchronous. Thewhile (entry)
loop is breaken from, leaving data in the buffer, but the request counter is zeroed out anyway.Here's the testing code
And the output:
The implications of this are super low, I understand, but you know, just in case.
The text was updated successfully, but these errors were encountered: