-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix(fetch): listener leaks on Socket #32956
Conversation
Now that I think about it, there's no way to send multiple requests concurrently in HTTP/1.1 - that's only added in HTTP2. I'll revert that change. |
@mxschmitt could you take a look and make sure that it fixes the error in our python distro? |
This comment has been minimized.
This comment has been minimized.
@@ -312,8 +312,11 @@ export abstract class APIRequestContext extends SdkObject { | |||
|
|||
let securityDetails: har.SecurityDetails | undefined; | |||
|
|||
const cleanup: (() => void)[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we want eventsHelper.addEventListener
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a nifty helper! done in a483cab
I wonder what does this mean for the timings? If the socket is reused, will it get zero |
This comment has been minimized.
This comment has been minimized.
Good question. I'll open a separate issue for us to investigate this.
That's what https://github.com/nodejs/node/blob/d2ad9b4fb6a6c4d54f14e19e0c74f1285ee5e402/doc/api/http.md#L60-L64 sounds like, yes. |
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"35822 passed, 619 skipped Merge workflow run. |
Closes #32951 `node:http` reuses TCP Sockets under the hood. We weren't cleaning up our listeners, leading to the `MaxListenersExceededWarning`. This PR adds cleanup logic. It also raises the warning threshhold, so that it doesn't trigger until there's 100 concurrent requests over the same socket.
Closes #32951
node:http
reuses TCP Sockets under the hood. We weren't cleaning up our listeners, leading to theMaxListenersExceededWarning
.This PR adds cleanup logic. It also raises the warning threshhold, so that it doesn't trigger until there's 100 concurrent requests over the same socket.