From 96ebd5f352c3eaf9ada5904a98444ceb48b52b21 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Tue, 30 Jun 2020 23:49:07 +0200 Subject: [PATCH] http: add note about timer unref PR-URL: https://github.com/nodejs/node/pull/34143 Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- lib/_http_server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/_http_server.js b/lib/_http_server.js index 842bfb5eb7a0d5..bef14bc880165c 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -568,6 +568,10 @@ function socketOnData(server, socket, parser, state, d) { } function onParserExecute(server, socket, parser, state, ret) { + // When underlying `net.Socket` instance is consumed - no + // `data` events are emitted, and thus `socket.setTimeout` fires the + // callback even if the data is constantly flowing into the socket. + // See, https://github.com/nodejs/node/commit/ec2822adaad76b126b5cccdeaa1addf2376c9aa6 socket._unrefTimer(); debug('SERVER socketOnParserExecute %d', ret); onParserExecuteCommon(server, socket, parser, state, ret, undefined);