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:
|
marco-ippolito
left a comment
There was a problem hiding this comment.
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 |
| const { createServer } = require('http'); | ||
| const { kConnectionsCheckingInterval } = require('_http_server'); | ||
|
|
||
| const server = createServer(function(req, res) {}); |
There was a problem hiding this comment.
| 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.
| const server = createServer(options, function(req, res) {}); | |
| const server = createServer(options); |
mcollina
left a comment
There was a problem hiding this comment.
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
|
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
|
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
The connection checking interval should get cleared when
https.Server.closeis called similarly to how it gets cleared whenhttp.Server.closeis called. Note that this also adds a call tocloseIdleConnections()tohttps.server.close.Fixes #48373