Skip to content

Commit e59f1f3

Browse files
committed
Requested changes addressed and resolved
1 parent 7c6ad38 commit e59f1f3

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

doc/api/http.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,12 +1936,13 @@ value only affects new connections to the server, not any existing connections.
19361936

19371937
<!-- YAML
19381938
added: v8.0.0
1939+
changes:
1940+
- version: v24.0.0
1941+
pr-url: https://github.com/nodejs/node/issues/59193
1942+
description: the default value for `http.Server.keepAliveTimeout` is changed from 5 to 60 seconds.
19391943
-->
19401944

1941-
* Type: {number} Timeout in milliseconds. **Default:** `5000` (5 seconds).
1942-
1943-
> **Note:** As of Node.js v24.0.0, the default value for `http.Server.keepAliveTimeout` is **60000ms (60s)**. Previous versions used **5000ms (5s)**. This aligns Node.js with browsers, proxies, and mobile clients, and avoids subtle connection failures. If your infrastructure expects the old value, set it explicitly. See [issue #59193](https://github.com/nodejs/node/issues/59193).
1944-
1945+
* Type: {number} Timeout in milliseconds. **Default:** `60000` (60 seconds).
19451946

19461947
The number of milliseconds of inactivity a server needs to wait for additional
19471948
incoming data, after it has finished writing the last response, before a socket

doc/changelogs/CHANGELOG_V24.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,6 @@ latest release and evaluate their potential impact on your applications.
624624
625625
## Notable Changes
626626
627-
### Breaking Changes
628-
- **http:** Changed the default value of `http.Server.keepAliveTimeout` from **5000ms (5s)** to **60000ms (60s)**. This prevents subtle long-connection failures due to premature socket closure, aligning with industry norms (browsers, proxies, mobile clients). See [issue #59193](https://github.com/nodejs/node/issues/59193).
629-
630-
631627
### V8 13.6
632628
633629
The V8 engine is updated to version 13.6, which includes several new

lib/_http_server.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -478,24 +478,10 @@ function storeHTTPOptions(options) {
478478

479479
const keepAliveTimeout = options.keepAliveTimeout;
480480
if (keepAliveTimeout !== undefined) {
481-
validateInteger(keepAliveTimeout, 'keepAliveTimeout', 0);
482-
this.keepAliveTimeout = keepAliveTimeout;
483-
if (keepAliveTimeout === 5000) {
484-
process.emitWarning(
485-
'You are explicitly setting http.Server.keepAliveTimeout to 5000ms (5s), which was the legacy default. ' +
486-
'This value is shorter than most industry infrastructure expects and can cause subtle connection failures. ' +
487-
'It is recommended to use a higher value, such as 60000ms (60s). See: https://github.com/nodejs/node/issues/59193',
488-
{ code: 'LEGACY_KEEPALIVETIMEOUT', detail: 'Consider increasing the value to match common proxy/browser defaults.' }
489-
);
490-
}
481+
validateInteger(keepAliveTimeout, 'keepAliveTimeout', 0);
482+
this.keepAliveTimeout = keepAliveTimeout;
491483
} else {
492-
this.keepAliveTimeout = 60_000; // 60 seconds
493-
process.emitWarning(
494-
'The default http.Server.keepAliveTimeout has changed from 5000ms (5s) to 60000ms (60s) in Node.js v24.0.0. ' +
495-
'This change aligns Node.js with common proxy and browser expectations and prevents subtle long-lived connection failures. ' +
496-
'If your application relies on the previous default, set it explicitly. See: https://github.com/nodejs/node/issues/59193',
497-
{ code: 'KEEPALIVETIMEOUT_DEFAULT_CHANGED', detail: 'Check your infrastructure and client expectations.' }
498-
);
484+
this.keepAliveTimeout = 60000; // 60 seconds;
499485
}
500486

501487
const connectionsCheckingInterval = options.connectionsCheckingInterval;

0 commit comments

Comments
 (0)