From 4f093e879b110771b586b701ddd2e9438a9e0eb9 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Tue, 14 May 2019 14:50:37 -0700 Subject: [PATCH] http, http2: flag for overriding server timeout Make it possible to override the default http server timeout. Ideally there should be no server timeout - as done on the master branch. This is a non-breaking way to enable platform providers to override the value. Ref: https://github.com/nodejs/node/issues/27558 Ref: https://github.com/nodejs/node/issues/27556 --- doc/api/cli.md | 12 ++++++++ doc/api/http.md | 7 +++++ doc/api/http2.md | 7 +++++ doc/node.1 | 3 ++ lib/_http_server.js | 5 ++- lib/https.js | 6 +++- lib/internal/http2/core.js | 8 +++-- src/node_options.cc | 5 +++ src/node_options.h | 1 + test/parallel/test-http-timeout-flag.js | 41 +++++++++++++++++++++++++ 10 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 test/parallel/test-http-timeout-flag.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 42950418282ef2..58ac360370a2c9 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -271,6 +271,17 @@ This flag exists to aid in experimentation with the internal implementation of the Node.js http parser. This flag is likely to become a no-op and removed at some point in the future. +### `--http-server-default-timeout=milliseconds` + + +Overrides the default value of `http`, `https` and `http2` server socket +timeout. Setting the value to 0 disables server socket timeout. Unless +provided, http server sockets timeout after 120s (2 minutes). Programmatic +setting of the timeout takes precedence over the value set through this +flag. + ### `--icu-data-dir=file`