summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2018-10-12 08:56:26 +0200
committerGeorge Adams <george.adams@uk.ibm.com>2018-10-15 19:40:51 +0100
commit1a2cf6696fa59c9723c423c4ff4c1167ab82155c (patch)
treef693eb6f3a152a7191e344ba79f8857ebcd834fb /lib
parent561e30d9ef581e86b36318fe22ebd1e82ab88754 (diff)
downloadandroid-node-v8-1a2cf6696fa59c9723c423c4ff4c1167ab82155c.tar.gz
android-node-v8-1a2cf6696fa59c9723c423c4ff4c1167ab82155c.tar.bz2
android-node-v8-1a2cf6696fa59c9723c423c4ff4c1167ab82155c.zip
async_hooks: remove promise object from resource
While it doesn't make any difference now. In the future PromiseHooks could be refactored to provide an asyncId instead of the promise object. That would make escape analysis on promises possible. Escape analysis on promises could lead to a more efficient destroy hook, if provide by PromiseHooks as well. But at the very least would allow the destroy hook to be emitted earlier. The destroy hook not being emitted on promises frequent enough is a known and reported issue. See https://github.com/nodejs/node/issues/14446 and https://github.com/Jeff-Lewis/cls-hooked/issues/11. While all this is speculation for now, it all depends on the promise object not being a part of the PromiseWrap resource object. Ref: https://github.com/nodejs/node/issues/14446 Ref: https://github.com/nodejs/diagnostics/issues/188 PR-URL: https://github.com/nodejs/node/pull/23443 Refs: https://github.com/nodejs/node/issues/14446 Refs: https://github.com/nodejs/diagnostics/issues/188 Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/domain.js7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/domain.js b/lib/domain.js
index e8ae3ff100..0caeb624b4 100644
--- a/lib/domain.js
+++ b/lib/domain.js
@@ -55,13 +55,6 @@ const asyncHook = createHook({
// if this operation is created while in a domain, let's mark it
pairing.set(asyncId, process.domain);
resource.domain = process.domain;
- if (resource.promise !== undefined &&
- resource.promise instanceof Promise) {
- // resource.promise instanceof Promise make sure that the
- // promise comes from the same context
- // see https://github.com/nodejs/node/issues/15673
- resource.promise.domain = process.domain;
- }
}
},
before(asyncId) {