-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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: avoid create new socket #1242
Conversation
relation joyent/node pr nodejs/node-v0.x-archive#13104 |
This bug come from 65f6f06#diff-5f7fb0850412c6be189faeddea6c5359L87 |
hm. we did not have a test for maxSockets check. |
This interpretation of |
The exists |
/cc @isaacs @TooTallNate can help me review this? |
var assert = require('assert'); | ||
var http = require('http'); | ||
var Agent = require('_http_agent').Agent; | ||
var EventEmitter = require('events').EventEmitter; |
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.
@fengmk2 The variable seems unnecessary because it is not used :)
How does this affect the behavior of |
c13bc34
to
8343963
Compare
@bnoordhuis It will be only keep |
@yorkie fixed |
console.log('http keepalive agent maxsockets test success.'); | ||
agent.destroy(); | ||
server.close(); | ||
} |
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.
@bnoordhuis remove process.exit
now.
Can one or two other @iojs/collaborators review this as well? |
8343963
to
edc3162
Compare
@bnoordhuis style fixed and console.log removed by your suggestion. |
LGTM |
It is a little hard to see what is actually changed, so maybe some more description in the commit message. Otherwise, LGTM. |
@tellnes how about these commit message?
|
eb5202a
to
d48a31a
Compare
@fengmk2 :) LGTM |
@fengmk2 Can you rebase your PR? There are some test failures that should be fixed in HEAD. |
ok,I will rebase soon Sent from my iPhone
|
When active sockets less than or equal to max sockets limit, should keep it instead of destroy it. Example: If maxSockets = 5 and a socket:4 become free, the freeSockets list will be: before: socket:4 will be destroy freeSockets: [0], [1], [2], [3] now: socket:4 will push to the end of list freeSockets: [0], [1], [2], [3], [4]
d48a31a
to
918e270
Compare
@bnoordhuis rebase done |
@bnoordhuis How to make test run again? |
By asking nicely. :-) https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/442/ |
@bnoordhuis test pass or I need to rebase again? |
Ran an updated Ci here: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/524/ looking good, merging soon. |
@fengmk2 is this commit log ok?
Edit, otherwise I can add this, but seems unnecessary:
|
@Fishrock123 ok, thanks! |
Allows the number of pooled free sockets to equal maxSockets. Previously it would only allow maxSockets - 1. PR-URL: #1242 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Christian Tellnes <[email protected]>
landed in 7956a13 - thanks. |
Thanks all! |
when active sockets reach max sockets limit