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

HTTP responses on Node v14.15.2+ hang #37210

Closed
clshortfuse opened this issue Feb 3, 2021 · 1 comment
Closed

HTTP responses on Node v14.15.2+ hang #37210

clshortfuse opened this issue Feb 3, 2021 · 1 comment

Comments

@clshortfuse
Copy link
Contributor

Version: v14.15.2
Platform: Linux ATTIC-PC 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: unsure

What steps will reproduce the bug?

Hosting http1 or http2 streams hang when the response is multi-chunked (large)

How often does it reproduce? Is there a required condition?

Send large responses over HTTP in v14.15.2

What is the expected behavior?

I have a payload for one HTTP request in application that is about 37KB which likely means this is multi-chunked. On v14.9-v14.15.1 there is no issue.

What do you see instead?

On v14.15.2 the response hangs. In total, the application is pushing about 50 requests to a client connection, but it's only this somewhat large one that completely hangs. I'm still troubleshooting to see what's going on.

Additional information

It doesn't matter if it's HTTPS (http1) or HTTP2. Both stall. I'd imagine it's stream related

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.15.2

@clshortfuse
Copy link
Contributor Author

Found it. Just some typo on my part handling the 'drain' event with a crypto hash stream:

const needsDrain = !hashStream.write(chunk);
if (needsDrain) {
  this.once('drain', () => {
    callback(null, chunk);
  });
} else {
  callback(null, chunk);
}

this.once => hashStream.once. Not a NodeJS bug, but tagging #35941 anyway for posterity. Hash streams might need draining whereas they didn't before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant