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: move free socket error handling to agent #32003

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Feb 28, 2020

The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Feb 28, 2020
@ronag ronag force-pushed the http-client-freesocket-error branch from 99d8e3e to 1f13aa4 Compare February 28, 2020 11:37
@ronag ronag requested review from lundibundi, bnoordhuis and mcollina and removed request for lundibundi February 28, 2020 11:45
lib/_http_agent.js Outdated Show resolved Hide resolved
@@ -746,6 +740,7 @@ function listenSocketTimeout(req) {
}

ClientRequest.prototype.onSocket = function onSocket(socket) {
// TODO(ronag): Should install error handler immediately.
Copy link
Member Author

@ronag ronag Feb 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be handled at some point in a separate PR. If an error is scheduled in the nextTick then it would become unhandled.

It's always been a problem as far as I can see.

@ronag ronag requested a review from lpinca February 28, 2020 12:28
lib/_http_agent.js Outdated Show resolved Hide resolved
lib/_http_client.js Outdated Show resolved Hide resolved
lib/_http_client.js Outdated Show resolved Hide resolved
lib/_http_client.js Outdated Show resolved Hide resolved
lib/_http_agent.js Outdated Show resolved Hide resolved
lib/_http_client.js Outdated Show resolved Hide resolved
@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 7, 2020
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 9, 2020
@addaleax
Copy link
Member

addaleax commented Mar 9, 2020

@ronag This needs a rebase :)

@ronag
Copy link
Member Author

ronag commented Mar 9, 2020

@ronag This needs a rebase :)

Damn! I keep causing conflicts :D.

@ronag ronag force-pushed the http-client-freesocket-error branch 2 times, most recently from bbe1217 to 2a2c211 Compare March 9, 2020 13:08
lib/_http_client.js Outdated Show resolved Hide resolved
@ronag
Copy link
Member Author

ronag commented Mar 9, 2020

@mcollina @jasnell I've significantly simplified and instead added TODO's, PTAL.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a CITGM run.

Is this going to affect https://www.npmjs.com/package/http-proxy-agent?

@BridgeAR
Copy link
Member

BridgeAR commented Mar 9, 2020

@nodejs-github-bot
Copy link
Collaborator

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 10, 2020
@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

CITGM looks good

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

Is this going to affect npmjs.com/package/http-proxy-agent?

@mcollina: As far as I can see, no. It just calls socket.destroy() directly in 'free'.

@ronag ronag removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 11, 2020
@ronag ronag requested review from addaleax and BridgeAR March 11, 2020 07:05
@ronag
Copy link
Member Author

ronag commented Mar 19, 2020

@nodejs/http

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 29, 2020
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 30, 2020
@addaleax
Copy link
Member

@ronag Looks like this needs to be rebased again.

The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.
@ronag ronag force-pushed the http-client-freesocket-error branch from b51610b to 1772f20 Compare March 30, 2020 06:47
@ronag
Copy link
Member Author

ronag commented Mar 30, 2020

rebased

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

Landed in 2bf0228

@addaleax addaleax closed this Mar 30, 2020
addaleax pushed a commit that referenced this pull request Mar 30, 2020
The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.

PR-URL: #32003
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
addaleax pushed a commit that referenced this pull request Mar 30, 2020
The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.

PR-URL: #32003
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
targos pushed a commit that referenced this pull request Apr 22, 2020
The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.

PR-URL: #32003
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants