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

investigate flaky test/parallel/test-http-many-ended-pipelines.js #37291

Closed
Trott opened this issue Feb 9, 2021 · 11 comments
Closed

investigate flaky test/parallel/test-http-many-ended-pipelines.js #37291

Trott opened this issue Feb 9, 2021 · 11 comments
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI.

Comments

@Trott
Copy link
Member

Trott commented Feb 9, 2021

  • Test: test/parallel/test-http-many-ended-pipelines.js
  • Platform: macOS 10.14, macOS 10.15
  • Console Output:
HTTP/1.1 200 OK
Date: Tue, 09 Feb 2021 08:14:57 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 2

ok
node:events:355
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:211:20)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:192:8)
    at emitErrorCloseNT (node:internal/streams/destroy:157:3)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  errno: -54,
  code: 'ECONNRESET',
  syscall: 'read'
}
@Trott Trott added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Feb 9, 2021
@Trott
Copy link
Member Author

Trott commented Feb 9, 2021

I'm able to replicate this locally with this command:

tools/test.py -j96 --repeat=1920 test/parallel/test-http-many-ended-pipelines.js

If I remove the -j96, I am unable to replicate it. So that suggests some sort of resource constraint (memory? CPU? network? file descriptors? something) makes the issue more likely to happen.

@Trott
Copy link
Member Author

Trott commented Feb 9, 2021

I know there's been some refactoring of streams and stream-like http/net events, and even some small breaking changes I believe.

@ronag @lpinca Any idea if the bug here is in the test code or if it's probably indicative of a bug in Node.js core?

@lpinca
Copy link
Member

lpinca commented Feb 9, 2021

It seems to me that the test is flaky by design. The socket might be destroyed server-side while the client is still writing to it.

@ronag
Copy link
Member

ronag commented Feb 9, 2021

I think the test is missing a 'error' handler. An ´ECONNRESET` looks like a expected/normal thing here.

@lpinca
Copy link
Member

lpinca commented Feb 9, 2021

The issue can be exacerbated by increasing numRequests. Setting it to 2000 makes the test always fail on my machine.

Also, there seems to be an unwanted MaxListenersExceededWarning caused by

node/lib/_http_incoming.js

Lines 180 to 183 in 33d3a2e

const cleanup = finished(this.socket, (e) => {
cleanup();
onError(this, e || err, cb);
});
. I think the condition here
if (this.socket && this.aborted) {
should prevent finished() from being called again with the same socket argument.

@lpinca
Copy link
Member

lpinca commented Feb 9, 2021

@ronag, the second issue (the unwanted warnings) seems to be caused by 2da3611. I'm not sure if it makes sense to revert it.

@ronag
Copy link
Member

ronag commented Feb 9, 2021

@ronag, the second issue (the unwanted warnings) seems to be caused by 2da3611. I'm not sure if it makes sense to revert it.

I don't think we should revert. I'll see if I can find a better solution.

@jameshilliard

This comment has been minimized.

@jameshilliard

This comment has been minimized.

@Trott

This comment has been minimized.

@jameshilliard

This comment has been minimized.

@lpinca lpinca mentioned this issue Mar 29, 2021
lpinca added a commit to lpinca/node that referenced this issue Apr 1, 2021
lpinca added a commit to lpinca/node that referenced this issue Apr 1, 2021
The socket might be destroyed by the other peer while data is still
being written. Add the missing error handler.

Fixes: nodejs#37291
lpinca added a commit to lpinca/node that referenced this issue Apr 3, 2021
The socket might be destroyed by the other peer while data is still
being written. Add the missing error handler.

Fixes: nodejs#37291
lpinca added a commit to lpinca/node that referenced this issue Apr 6, 2021
The socket might be destroyed by the other peer while data is still
being written. Add the missing error handler.

Fixes: nodejs#37291
@lpinca lpinca closed this as completed in cc4ee6c Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants