This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
http.get(url, cb) hangs after 5 requests on node v0.10.32 #8443
Labels
Comments
You are using the default (pooled) http agent from the client, which limits the number of maximum open connections to the same server to 5. In addition, the var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(2000);
var ix = 0;
setInterval(function () {
http.get('http://localhost:2000/', function (res) {
// enter flowing mode
res.resume();
console.log({ix: ix++, status: res.statusCode});
});
}, 200); While this isn't a bug, it would be great to add to the http.get and http.request documentation so that future users aren't surprised by this behavior! Would you care to do the honors? |
jasnell
pushed a commit
to nodejs/node
that referenced
this issue
Dec 14, 2015
Refs: nodejs/node-v0.x-archive#25471 Refs: nodejs/node-v0.x-archive#8443 PR-URL: #4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
cjihrig
pushed a commit
to nodejs/node
that referenced
this issue
Dec 15, 2015
Refs: nodejs/node-v0.x-archive#25471 Refs: nodejs/node-v0.x-archive#8443 PR-URL: #4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
to nodejs/node
that referenced
this issue
Dec 30, 2015
Refs: nodejs/node-v0.x-archive#25471 Refs: nodejs/node-v0.x-archive#8443 PR-URL: #4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
to nodejs/node
that referenced
this issue
Jan 19, 2016
Refs: nodejs/node-v0.x-archive#25471 Refs: nodejs/node-v0.x-archive#8443 PR-URL: #4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
scovetta
pushed a commit
to scovetta/node
that referenced
this issue
Apr 2, 2016
Refs: nodejs/node-v0.x-archive#25471 Refs: nodejs/node-v0.x-archive#8443 PR-URL: nodejs#4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I found the strange behavior when I use http.get(url, cb) simply.
I verified this on Windows 7 / 8.1, CentOS 6.5 with official binary.
node v0.11.9 looks good.
I think this condition is insufficient:
https://github.com/joyent/node/blob/v0.10.32/lib/http.js#L1694-L1698
Test code is below:
Output with NODE_DEBUG=http
The text was updated successfully, but these errors were encountered: