Skip to content

Commit bb3ef78

Browse files
robhoganfacebook-github-bot
authored andcommitted
Remove HTTP keepAliveTimeout workaround not needed since Node.js 12 (#52561)
Summary: Pull Request resolved: #52561 The removed code comment is pretty clear that this workaround is in place for a specific bug, which was closed in a Node.js 8.x minor: nodejs/node#13391 A related issue descibed a problem that still existed in Node 10: nodejs/node#27363 Subsequent comments reporting problems with newer Node.js versions all seem to relate to mismatched configuration with load balancers, not directly relevant to Metro. Reproducers for the original bugs no longer repro on new Node.js (tested with 22.14), so I think it's safe to conclude this is fixed. Changelog: [Internal] Reviewed By: huntie Differential Revision: D78158427 fbshipit-source-id: 0be5dbc4334ac7b0bbccde44a840caac43deb4df
1 parent b855025 commit bb3ef78

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

  • packages/community-cli-plugin/src/commands/start

packages/community-cli-plugin/src/commands/start/runServer.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function runServer(
147147
// $FlowIgnore[cannot-write] Assigning to readonly property
148148
metroConfig.reporter = reporter;
149149

150-
const serverInstance = await Metro.runServer(metroConfig, {
150+
await Metro.runServer(metroConfig, {
151151
host: args.host,
152152
secure: args.https,
153153
secureCert: args.cert,
@@ -161,18 +161,6 @@ async function runServer(
161161

162162
reportEvent = eventsSocketEndpoint.reportEvent;
163163

164-
// In Node 8, the default keep-alive for an HTTP connection is 5 seconds. In
165-
// early versions of Node 8, this was implemented in a buggy way which caused
166-
// some HTTP responses (like those containing large JS bundles) to be
167-
// terminated early.
168-
//
169-
// As a workaround, arbitrarily increase the keep-alive from 5 to 30 seconds,
170-
// which should be enough to send even the largest of JS bundles.
171-
//
172-
// For more info: https://github.com/nodejs/node/issues/13391
173-
//
174-
serverInstance.keepAliveTimeout = 30000;
175-
176164
await version.logIfUpdateAvailable(cliConfig, terminalReporter);
177165
}
178166

0 commit comments

Comments
 (0)