Skip to content
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: fix disparity between buffer and the count #15661

Closed

Conversation

jlvivero
Copy link
Contributor

This changes the disparity of bufferedRequestCount and the actual buffer
on file _stream_writable.js
Fixes: #6758

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

Stream Writable

Note: I introduced the test in the sequential subfolder because I couldn't think of another way to test that part of the code without using a timeout (like in the example of the issue thread).

This changes the disparity of bufferedRequestCount and the actual buffer
on file _stream_writable.js
Fixes: nodejs#6758
@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Sep 28, 2017
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be nice to address the nit - otherwise this could be done while landing.

'use strict';
const common = require('../common');
const Stream = require('stream');
//this test ensures that the _writeableState.bufferedRequestCount and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - would you be so kind upper case the first letter and also add a whitespace after //?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure no problem, would there be any other style changes you'd think might be appropriate? If not I'll just commit with that one change and squash if required/requested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the comment below, please also add a whitespace on each line after //. Besides that everything is LGTM.

@jasnell
Copy link
Member

jasnell commented Sep 29, 2017

ping @nodejs/streams

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with CI green

@BridgeAR
Copy link
Member

BridgeAR commented Oct 1, 2017

@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2017

Landed in 34dbc9e

@BridgeAR BridgeAR closed this Oct 2, 2017
BridgeAR pushed a commit that referenced this pull request Oct 2, 2017
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>
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Oct 3, 2017
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
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>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 4, 2017
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>
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
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>
@MylesBorins
Copy link
Member

This lands cleanly on v6.x, but I think it might make sense to wait a bit longer to see if it causes any issues due to how fragile streams could be.

Please lmk if you think it should make it into the next release

@MylesBorins
Copy link
Member

ping @mcollina and @nodejs/streams should this be included in the next 6.x?

@mcollina
Copy link
Member

@MylesBorins yeah, go ahead and backport. It's safe.

MylesBorins pushed a commit that referenced this pull request Dec 20, 2017
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>
MylesBorins pushed a commit that referenced this pull request Jan 2, 2018
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>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stream.Writable reports wrong number in _writableState.bufferedRequestCount
7 participants