-
Notifications
You must be signed in to change notification settings - Fork 229
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
OOM in test/parallel/test-stream-pipeline #353
Comments
Can you please verify that this is the case with the latest version of Node 6 on Windows? 6.8.0 is pretty old, and it might be a Windows-specific bug. This is either a) a Windows-bug in Node 6 (which we probably won’t fix) b) a bug in the stream machinery. Anyway, the test should not go OOM in any case. Can you send a PR to Node core that limits the numbers of pushes to 42 (random number)? Don’t push null, as the test verifies that destroy must be called. |
Also happens on node 6.14.3.
How can we find out? If we limit the number of pushes to 42, won't that hide a potential bug?
Roger. Side note: the lack of assertions, assertion messages or comments makes it hard to tell what the purpose of these tests is - which makes me hesitant to contribute. |
cc @mafintosh (added the test) IMHO that logic in that test is faulty in Node < 10, where .push call read synchronously. |
I'll take a look. You're probably right. |
FWIW the OOM also happens in:
|
Related? This throws on node 10 (and const stream = require('stream')
stream.pipeline(
new stream.Readable({
read (size) {
if (this.destroyed) throw new Error('late read')
this.push('foo')
}
}),
new stream.Writable({
write (chunk, enc, next) {
next(new Error('stop'))
}
}),
(err) => {}
) |
@vweevers what does that throw? |
|
(Intuitively, I do not expect _read to be called after destroy, but it is) |
I think we are missing a check somewhere about this, it should not happen. |
The following test passes: 'use strict';
const common = require('../common');
const assert = require('assert');
const { Readable } = require('stream');
const rs = new Readable({
read: common.mustCall(function() {
this.push('hello');
}, 3)
});
rs.on('data', () => {
rs.destroy();
}); It is normal that multiple The problem you are seeing on Windows is the result of some differences in libuv between Unix and Windows, and some bad interactions between the tests: the event loop is always filled with tasks to execute and it keep accepting things. I'm sending a PR against core now to fix the test. |
This test is ported automatically in readable-stream, and it fails there on Windows and older Node.js versions because of some bad interactions between the code and the event loop on Windows. See: nodejs/readable-stream#353
This test is ported automatically in readable-stream, and it fails there on Windows and older Node.js versions because of some bad interactions between the code and the event loop on Windows. See: nodejs/readable-stream#353 PR-URL: nodejs#22456 Reviewed-By: Mathias Buus <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
This test is ported automatically in readable-stream, and it fails there on Windows and older Node.js versions because of some bad interactions between the code and the event loop on Windows. See: nodejs/readable-stream#353 PR-URL: #22456 Reviewed-By: Mathias Buus <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
This test is ported automatically in readable-stream, and it fails there on Windows and older Node.js versions because of some bad interactions between the code and the event loop on Windows. See: nodejs/readable-stream#353 PR-URL: #22456 Reviewed-By: Mathias Buus <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
This should be fixed in the master and 3.0.3. Please let me know! |
@mcollina Confirmed, tests are passing on Windows. Thanks! 🎉 |
On Windows 10 with node 6.8.0 x64, multiple tests in
test/parallel/test-stream-pipeline.js
are failing with OOM errors.I suspect the failures are related to one another, but I do not fully understand what is happening, so let's start by diving into one of them:
readable-stream/test/parallel/test-stream-pipeline.js
Lines 183 to 212 in 9004c81
I think this test goes into an endless loop. The use of
setImmediate
to destroy the HTTP response, means thatread
on L186 will be continuously called, tick after tick. But if that's true, why doesn't it happen on other versions/platforms too?@mcollina any idea?
Because
pipeline
was introduced in node 10 and the error only occurs on node 6 (I did not yet test versions between 6 and 10), I reckonedreadable-stream
is the proper repo for this issue - correct me if I'm wrong.The text was updated successfully, but these errors were encountered: