-
Notifications
You must be signed in to change notification settings - Fork 29.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
http: emit close on socket re-use #28685
Conversation
05c108f
to
5c11992
Compare
@benjamingr I think I'm getting close to spamming issues and PR's now... I'll stop here for now until some of the other's get merged or closed. If there anyway I can help speed up the process feel free to let me know. Matteo has my mail if you want to setup any phone chat. |
You are not spamming PRs or issues everything here has substance, it is getting slow uptake because there aren't many people who understand this area in the code not because the changes are bad. Please keep making PRs :] |
Defensively marking as semver-major as this has a non-zero chance of breaking at least someone. |
5c11992
to
de246fc
Compare
tests added and bugs fixed |
286fc50
to
15f46b5
Compare
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.
LGTM
Needs a CITGM run but CITGM is kinda-sorta blocked by standard-things/esm#821 right now (as that issue causes a number of failures in CITGM, or at least that's my understanding). |
15f46b5
to
ff6911b
Compare
@Trott: can we get that CITGM on this one? |
CITGM (queued): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1995/ |
@Trott can we land this? |
We can't, this is breaking Ember:
|
Ember? Interesting. Would you like me to take a look? |
yes please!
Il giorno mer 11 set 2019 alle ore 18:52 Robert Nagy <
[email protected]> ha scritto:
… Ember? Interesting. Would you like me to take a look?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#28685?email_source=notifications&email_token=AAAMXY2TL4DONOEXFWVHPCDQJEO6NA5CNFSM4IDRZ6A2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PEUHY#issuecomment-530467359>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAMXY2VRRQ4IGP5JZ5PMVLQJEO6NANCNFSM4IDRZ6AQ>
.
|
It's actually yarn that fails here: // Be a good stream and emit end when the response is finished.
// Hack to emit end on close because of a core bug that never fires end
response.on('close', function () {
if (!self._ended) {
self.response.emit('end')
}
})
response.once('end', function () {
self._ended = true
}) Looks like a bug in yarn. It should be checking |
41e33d0
to
e224aba
Compare
This needed some refactoring to make CITGM pass and resolve conflicts. Will request re-reviews once I get an ok from Travis. |
@@ -629,7 +630,7 @@ function responseOnEnd() { | |||
socket.end(); | |||
} | |||
assert(!socket.writable); | |||
} else if (req.finished) { | |||
} else if (req.finished && !this.aborted) { |
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.
If response is aborted
then the socket is closed and there is nothing to keep alive.
41e6890
to
3c7d3f9
Compare
3c7d3f9
to
55d1d3d
Compare
req.emit('close'); | ||
if (req.res) { | ||
req.res.emit('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.
Had to move the close emitters here to ensure they are emitted after all userland 'end' handlers have completed.
@Trott ready to land? |
CITGM results look good. |
@nodejs/http @nodejs/collaborators Some final reviews on this one? |
PR-URL: #28685 Refs: #28684 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Landed in d247a8e |
When using agents we currently don't emit
'close'
on req & res.I will need a little help here... I don't think I quite got it right.
Refs: #28684
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes