-
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
https: fix connection checking interval not clearing on server close #48383
https: fix connection checking interval not clearing on server close #48383
Conversation
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373
Review requested:
|
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.
I'm not confident approving this without a test
I looked and couldn't find any tests for this specific The original intention that was approved here was to add it to https as well, but it was just an oversight that |
Shouldn't it be possible to write a minimal test based on the code in the original issue? |
I assumed that the question was something more functional than that. If it's just adding a test to check that the timer was cleared, it's not very difficult to check (The test would know some internals, as the timer hides behind a symbol so we'd need to expose it, but IMO it's not that bad). |
I second @marco-ippolito. Code changes look fine but we need tests, thanks :) |
added tests as requested, note that I also changed an existing test as the call to |
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
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
const { createServer } = require('http'); | ||
const { kConnectionsCheckingInterval } = require('_http_server'); | ||
|
||
const server = createServer(function(req, res) {}); |
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.
const server = createServer(function(req, res) {}); | |
const server = createServer(); |
cert: fixtures.readKey('agent1-cert.pem') | ||
}; | ||
|
||
const server = createServer(options, function(req, res) {}); |
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.
const server = createServer(options, function(req, res) {}); | |
const server = createServer(options); |
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 awesome. I think I suffered from this bug as well.
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: #48373 PR-URL: #48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373 PR-URL: nodejs#48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373 PR-URL: nodejs#48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: #48373 PR-URL: #48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
This PR broke citgm on |
How did it broke CITGM? |
oh sorry I forgot to add some more details, it broke
And here is the link to the full CITGM run: https://ci.nodejs.org/job/citgm-smoker/3229/ |
it looks like it also broke |
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373 PR-URL: nodejs#48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373 PR-URL: nodejs#48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. fixes: nodejs#48373 PR-URL: nodejs#48383 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. Fixes: #48373 PR-URL: #48383 Backport-PR-URL: #50194 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
why have we changed the behavior in minor release? i.e Is there any way to keep old behavior on v18. I completely understand and agree with adding a new method to handle it but modifying the existing one i.e server.close, it broke our app/tests. In an environment where we own client and server, we usually keep client timeout less than server keepalive timeout and let the client know by connection:close header to handle future request. Scenario: There could be multiple stack in different language talking to each other. related to #52330 CC: @mcollina @ShogunPanda Thoughts |
This wasn't a semver-minor, it was a bug fix for a Node 19 change that was added here that missed that the added behavior to HTTP did not automatically apply to HTTPS, which was marked at the time as a semver-major. If I'm understanding correctly, the backport to 18 has a mistake #50194, it shouldn't have added |
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. Fixes: nodejs/node#48373 PR-URL: nodejs/node#48383 Backport-PR-URL: nodejs/node#50194 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. Fixes: nodejs/node#48373 PR-URL: nodejs/node#48383 Backport-PR-URL: nodejs/node#50194 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
The connection checking interval should get cleared when
https.Server.close
is called similarly to how it gets cleared whenhttp.Server.close
is called. Note that this also adds a call tocloseIdleConnections()
tohttps.server.close
.Fixes #48373