You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue with Node 4.x when receiving pipelined reqeusts #3332
After updating to Node 4.x from 0.12.x, benchmarking by sending pipelining requests results in an initial spike of requests followed by no requests being processed on those connections, and those connections remaining open even after the load generator client finishes (connection leak). The same behavior does not occur when not pipelining requests, and it doesn't occur on 0.10.x or 0.12.x at all. The issue reproduces on both Linux and Windows.
I'm generating load using "wrk" (from a remote Linux machine) and the app is the benchmark app from the TechEmpower benchmarks.
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index 6650c06..366c516 100644
--- a/lib/_http_outgoing.js+++ b/lib/_http_outgoing.js@@ -663,6 +663,9 @@ OutgoingMessage.prototype._flush = function() {
this.output = [];
this.outputEncodings = [];
this.outputCallbacks = [];
+ if (this._onPendingData !== null)+ this._onPendingData(-this.outputSize);+ this.outputSize = 0;
}
if (this.finished) {
diff --git a/lib/_http_server.js b/lib/_http_server.js
index c11d369..ffaa0b8 100644
--- a/lib/_http_server.js+++ b/lib/_http_server.js@@ -270,6 +270,7 @@ function connectionListener(socket) {
// need to pause TCP socket/HTTP parser, and wait until the data will be
// sent to the client.
outgoingData += delta;
+ console.log(outgoingData);
if (socket._paused && outgoingData < socket._writableState.highWaterMark)
return socketOnDrain();
}
@@ -405,6 +406,7 @@ function connectionListener(socket) {
if (socket._paused) {
// onIncoming paused the socket, we should pause the parser as well
debug('pause parser');
+ parser.unconsume(socket._handle._externalStream);
socket.parser.pause();
}
}
@NawarA ... smoke testing the v4.x branch would be helpful. If you pull the branch, do a fresh build, does it resolve the issue or are there specific commits we still need to land to address the issue?
Good to know. I thought because it was as stream where piping was failing, and due to me seeing this issue after upgrading, that the issue was related. Thanks for sharing @indutny
Good to know. I thought because it was as stream where piping was failing,
and due to me seeing this issue after upgrading, that the issue was
related. Thanks for sharing @indutnyhttps://github.com/indutny
—
Reply to this email directly or view it on GitHub #3332 (comment).
Activity
rmg commentedon Oct 12, 2015
@DamianEdwards which specific version? v4.2.0? v4.1.2?
DamianEdwards commentedon Oct 13, 2015
I reproduced on both 4.1.2 and 4.2.0
brendanashworth commentedon Oct 13, 2015
Does it occur on 4.1.1? There were a few changes in 4.1.2 (0504066, b3d9678) that might be causing this.
DamianEdwards commentedon Oct 13, 2015
I'll drop back to 4.1.1 tomorrow and try it out.
Fishrock123 commentedon Oct 13, 2015
cc @indutny
indutny commentedon Oct 13, 2015
@DamianEdwards does removing those lines help?
indutny commentedon Oct 13, 2015
Actually, latter one should be enough to verify it.
DamianEdwards commentedon Oct 13, 2015
@indutny I'm assuming I have to build from source to try out removing that line?
indutny commentedon Oct 13, 2015
@DamianEdwards yeah. Sorry, I forgot to mention it.
DamianEdwards commentedon Oct 13, 2015
@indutny 😄
I'll see what I can do. That change was added in 4.1.2?
indutny commentedon Oct 13, 2015
Yep.
indutny commentedon Oct 13, 2015
Found one bug, already:
Looking for more.
indutny commentedon Oct 13, 2015
Second part of issue is handling of paused parser in consumed socket. Working on fix.
indutny commentedon Oct 13, 2015
Full fix:
@DamianEdwards may I ask you to give it a try?
9 remaining items
NawarA commentedon Oct 22, 2015
Hey guys, I believe we're seeing this issue in production for 4.2.1. I can share the error if that'd be helpful.
I believe @indutny fixed this, right? If so, why isn't this released? This should be considered a hotfix and get released as a 4.2.2 release ASAP
Just curious on whats going on with this given what we're seeing, given its fixed, and given the fix is unreleased
jasnell commentedon Oct 22, 2015
@NawarA ... I'm likely going to be taking a look at spinning out a 4.2.2 early next week.
NawarA commentedon Oct 22, 2015
@jasnell thanks. I had to roll back to iojs to keep production stable. Let me know if I can help with the release
jasnell commentedon Oct 22, 2015
@NawarA ... smoke testing the v4.x branch would be helpful. If you pull the branch, do a fresh build, does it resolve the issue or are there specific commits we still need to land to address the issue?
NawarA commentedon Oct 22, 2015
Will do. To confirm the error and ensure its related to this issue, here's what I'm seeing:
I'll pull the latest master branch, and see if it resolves the issue.
indutny commentedon Oct 22, 2015
@NawarA this does not look related to this issue
NawarA commentedon Oct 22, 2015
Good to know. I thought because it was as stream where piping was failing, and due to me seeing this issue after upgrading, that the issue was related. Thanks for sharing @indutny
indutny commentedon Oct 22, 2015
Pipelining, not piping ;)
On Thursday, October 22, 2015, Nawar Alsafar notifications@github.com
wrote:
http: fix stalled pipeline bug
http: fix stalled pipeline bug
http: fix stalled pipeline bug