-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: do not add .domain to promises in VM contexts #15695
Conversation
doc/api/domain.md
Outdated
@@ -1,6 +1,13 @@ | |||
# Domain | |||
<!-- YAML | |||
changes: | |||
- version: REPLACEME | |||
pr-url: https://github.com/nodejs/node/pull/REPLACEME | |||
description: `Promise`s created in VM contexts no longer have a `.domain` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the YAML parser has issues with values that start with a backtick? Can you double-check this works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@bnoordhuis, do you have an opinion on this PR? |
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. Fixes: nodejs#15673
CI is green. Okay to land this with semver-patch? @nodejs/tsc |
+1 to semver-patch |
Landed in 8068577. |
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. PR-URL: nodejs#15695 Fixes: nodejs#15673 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Not landing clean on 8.x, could you please backport? |
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. PR-URL: nodejs/node#15695 Fixes: nodejs/node#15673 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. Backport-PR-URL: REPLACEME PR-URL: nodejs#15695 Fixes: nodejs#15673 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. Backport-PR-URL: #16074 PR-URL: #15695 Fixes: #15673 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Should this be backported to |
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is now simply hidden, in order to prevent objects from outside from leaking into a VM context.
Fixes (and see more context at): #15673
This is technically a breaking change, as it removes a property from created Promise objects under certain circumstances. However, I would argue that this should be landed as semver-patch, for the following reasons:
.domain
property on promises..domain
on Promises is inconsistent at best. Right now, the property exists only if it was created in a running domain, which means that modules that do not have control over domains (i.e. pretty much all modules except for the very core of a program) cannot depend on the presence of this property.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src