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

Readable stops reading #26097

Closed
lpinca opened this issue Feb 14, 2019 · 2 comments
Closed

Readable stops reading #26097

lpinca opened this issue Feb 14, 2019 · 2 comments
Labels
stream Issues and PRs related to the stream subsystem.

Comments

@lpinca
Copy link
Member

lpinca commented Feb 14, 2019

  • Version: >= 10.0.0
  • Platform: any
  • Subsystem: stream

Consider the following example, born from discussion in #25969.

const { Readable } = require('stream');

const buf = Buffer.alloc(8192);

const readable = new Readable({
  read() {
    this.push(buf);
  }
});

readable.on('readable', function() {
  const data = readable.read();
  console.log(data.length);
});

Note that readable.read() is not called in a loop on purpose.

Expected behavior

An endless loop. This works as expected in Node.js < 10.0.0.

Actual behavior

Reading stops after a few reads.


Bisecting points to this commit: 0778f79.

@lpinca lpinca added the stream Issues and PRs related to the stream subsystem. label Feb 14, 2019
@targos
Copy link
Member

targos commented Feb 14, 2019

@nodejs/streams

@mcollina
Copy link
Member

Fixed in cd302d7.

pull bot pushed a commit to zys-contrib/node that referenced this issue Feb 28, 2019
Fixes: nodejs#26097

PR-URL: nodejs#26135
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax pushed a commit that referenced this issue Mar 1, 2019
Fixes: #26097

PR-URL: #26135
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BethGriggs pushed a commit that referenced this issue Jul 9, 2019
Fixes: #26097

PR-URL: #26135
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BethGriggs pushed a commit that referenced this issue Jul 17, 2019
Fixes: #26097

PR-URL: #26135
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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 a pull request may close this issue.

3 participants