Skip to content

Commit

Permalink
http: remove closeIdleConnections function while calling server close.
Browse files Browse the repository at this point in the history
Correcting the nodejs#50194 backporting mistake.
closeIdleConnections shouldnot be called while server.close in node v18.
This behavior is for node v19 and above.

fixes: nodejs#52330, nodejs#51677
  • Loading branch information
kumarrishav committed Apr 2, 2024
1 parent 8c8961d commit bdb3b64
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 38 deletions.
1 change: 0 additions & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ function setupConnectionsTracking() {
}

function httpServerPreClose(server) {
server.closeIdleConnections();
clearInterval(server[kConnectionsCheckingInterval]);
}

Expand Down
13 changes: 0 additions & 13 deletions test/parallel/test-http-server-close-destroy-timeout.js

This file was deleted.

1 change: 1 addition & 0 deletions test/parallel/test-http-server-close-idle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ server.listen(0, function() {
assert(response.startsWith('HTTP/1.1 200 OK\r\nConnection: keep-alive'));
assert.strictEqual(connections, 2);

server.closeIdleConnections();
server.close(common.mustCall());

// Check that only the idle connection got closed
Expand Down
24 changes: 0 additions & 24 deletions test/parallel/test-https-server-close-destroy-timeout.js

This file was deleted.

1 change: 1 addition & 0 deletions test/parallel/test-https-server-close-idle.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ server.listen(0, function() {
assert(response.startsWith('HTTP/1.1 200 OK\r\nConnection: keep-alive'));
assert.strictEqual(connections, 2);

server.closeIdleConnections();
server.close(common.mustCall());

// Check that only the idle connection got closed
Expand Down

0 comments on commit bdb3b64

Please sign in to comment.