Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
819a647
esm: fix esm load bug
ZYSzys May 13, 2019
cc3ca08
test: clearing require cache crashes esm loader
aduh95 May 2, 2019
8f780e8
deps: cherry-pick 88f8fe1 from upstream V8
hashseed Nov 20, 2018
609d2b9
deps: V8: backport f27ac28
targos Jun 4, 2019
5ffe047
tls: renegotiate should take care of its own state
sam-github Feb 7, 2019
08a32fb
src: elevate v8 namespaces for node_process.cc
Jayasankar-m Nov 23, 2018
65ef26f
async_hooks: avoid double-destroy HTTPParser
Flarna May 30, 2019
0dee607
src: extract common Bind method
maclover7 Aug 14, 2018
14090b5
worker: fix nullptr deref after MessagePort deser failure
addaleax Dec 16, 2018
a8f78f0
src: fulfill Maybe contract in InlineDecoder
addaleax Dec 19, 2018
b7dbc1c
src: fix warning in cares_wrap.cc
cjihrig Dec 26, 2018
b3d8a1b
doc: add missing changes entry
BridgeAR Nov 30, 2018
76af23a
src: remove internalBinding('config').warningFile
joyeecheung Dec 11, 2018
044e753
stream: make _read() be called indefinitely if the user wants so
mcollina Feb 15, 2019
274b97c
stream: do not unconditionally call `_read()` on `resume()`
addaleax Mar 28, 2019
f34bb96
process: make stdout and stderr emit 'close' on destroy
mcollina Mar 15, 2019
f3841c6
stream: convert existing buffer when calling .setEncoding
addaleax May 28, 2019
ad588eb
doc: adjust TOC margins
silverwind Jun 5, 2019
b689008
src: in-source comments and minor TLS cleanups
sam-github Jan 16, 2019
f9e8e88
src: fix Get() usage in tls_wrap.cc
cjihrig Nov 3, 2018
99dad28
tls: add CHECK for impossible condition
addaleax Mar 21, 2019
75052ca
tls: add debugging to native TLS code
addaleax Mar 21, 2019
35be08a
test: clean up build files
Jun 19, 2019
39637cb
test: skip tests related to CI failures on AIX
sam-github Jun 28, 2019
2ae9916
test: skip stringbytes-external-exceed-max on AIX
sam-github Jul 2, 2019
ada0ed5
test: fix pty test hangs on aix
bnoordhuis Jul 8, 2019
c59e0c2
deps: updated openssl upgrade instructions
sam-github Jun 12, 2019
9e62852
deps: upgrade openssl sources to 1.1.1c
sam-github Jun 12, 2019
8f5d6cf
deps: update archs files for OpenSSL-1.1.1c
sam-github Jun 12, 2019
4a607fa
tools: replace rollup with ncc
Trott Dec 3, 2018
f332265
test: remove `util.inherits()` usage
ZYSzys Dec 28, 2018
0339fba
src: handle empty Maybe in uv binding initialize
addaleax Dec 17, 2018
a395299
2019-07-31, Version 10.16.1 'Dubnium' (LTS)
BethGriggs Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stream: do not unconditionally call _read() on resume()
`readable.resume()` calls `.read(0)`, which in turn previously set
`needReadable = true`, and so a subsequent `.read()` call would
call `_read()` even though enough data was already available.

This can lead to elevated memory usage, because calling `_read()`
when enough data is in the readable buffer means that backpressure
is not being honoured.

Fixes: #26957

PR-URL: #26965
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
addaleax authored and BethGriggs committed Jul 16, 2019
commit 274b97c4eaeb1de0eb41bdfcafd3e0eb0d015266
2 changes: 1 addition & 1 deletion lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ Readable.prototype.read = function(n) {
ret = null;

if (ret === null) {
state.needReadable = true;
state.needReadable = state.length <= state.highWaterMark;
n = 0;
} else {
state.length -= n;
Expand Down
21 changes: 21 additions & 0 deletions test/parallel/test-stream-readable-resume-hwm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';
const common = require('../common');
const { Readable } = require('stream');

// readable.resume() should not lead to a ._read() call being scheduled
// when we exceed the high water mark already.

const readable = new Readable({
read: common.mustNotCall(),
highWaterMark: 100
});

// Fill up the internal buffer so that we definitely exceed the HWM:
for (let i = 0; i < 10; i++)
readable.push('a'.repeat(200));

// Call resume, and pause after one chunk.
// The .pause() is just so that we don’t empty the buffer fully, which would
// be a valid reason to call ._read().
readable.resume();
readable.once('data', common.mustCall(() => readable.pause()));