From d442a9c5b16804b4591dc020780fcf9c2723651c Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 29 Jan 2018 14:42:40 -0500 Subject: [PATCH 1/2] http: remove domain specific code Due to some changes to async tracking of http and also in how domains are handled, it's no logner necessary to manually copy domain from req to res in http code. --- lib/_http_client.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index a9ee686c69a67f..15f566b57c1d84 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -458,12 +458,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) { var socket = this.socket; var req = socket._httpMessage; - // propagate "domain" setting... - if (req.domain && !res.domain) { - debug('setting "res.domain"'); - res.domain = req.domain; - } - debug('AGENT incoming response!'); if (req.res) { From 8cfa05d9a46abebe7565bfa569a50daff802c227 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 29 Jan 2018 14:52:01 -0500 Subject: [PATCH 2/2] timers: remove domain specific code It is no longer necessary to explicitly set the handle to inherit the Timeout domain. --- lib/timers.js | 1 - test/parallel/test-domain-timers.js | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index db43a7491de72f..68631e8aebf7fd 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -576,7 +576,6 @@ Timeout.prototype.unref = function() { this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; this._handle.start(delay); - this._handle.domain = this.domain; this._handle.unref(); } return this; diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index fe7247b2a92c95..f9857a991af880 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -30,13 +30,19 @@ timeoutd.on('error', common.mustCall(function(e) { assert.strictEqual(e.message, 'Timeout UNREFd', 'Domain should catch timer error'); clearTimeout(timeout); -})); +}, 2)); +let t; timeoutd.run(function() { setTimeout(function() { throw new Error('Timeout UNREFd'); }, 0).unref(); + + t = setTimeout(function() { + throw new Error('Timeout UNREFd'); + }, 0); }); +t.unref(); const immediated = domain.create();