GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — domain: re-implement domain over async_hook by vdeturckheim · Pull Request #16222 · nodejs/node

Conversation

@vdeturckheim

@vdeturckheim vdeturckheim commented Oct 15, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

Tentative to re-implement domains over async_hook API.

Currently this breaks the following tests:

  • those using --abort-on-uncaught-exception flag: I have not found a way to intercept those errors event by looking to process._fatalException
    • parallel/test-domain-abort-on-uncaught.js
    • parallel/test-domain-with-abort-on-uncaught-exception
  • the one which expect an exit code of 7 when an error is thrown from a domain error handler: I have not found where this was done in the previous version.
    • test-domain-top-level-error-handler-throw
  • those linked to makeCallback: It seems there is some domain handling happening in native code I could not fix.
    • addons/make-callback-recurse/test
    • addons-napi/test_make_callback_recurse/test

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax, sansmischevia, AndreasMadsen, and LewisJEllis reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
@nodejs-github-bot nodejs-github-bot added domain Issues and PRs related to the domain subsystem. process Issues and PRs related to the process subsystem. labels Oct 15, 2017
@addaleax addaleax added the wip Issues and PRs that are still a work in progress. label Oct 15, 2017
addaleax
addaleax reviewed Oct 15, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@addaleax addaleax Oct 15, 2017

Copy link
Copy Markdown
Member

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.

You probably also want to set resource.domain = process.domain in this case

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 15, 2017

Copy link
Copy Markdown
Member Author

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.

Done, good point!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@addaleax addaleax self-assigned this Oct 15, 2017
@addaleax

addaleax commented Oct 15, 2017

Copy link
Copy Markdown
Member

Cool that you’re taking this on! I’ll assign myself because I really want to see this happen and hope I can help here, please don’t take this as a sign that I’ll be claiming any specific tasks for only me :)

vdeturckheim and ORESoftware reacted with hooray emoji
All reactions
  • 🎉 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vdeturckheim

vdeturckheim commented Oct 15, 2017

Copy link
Copy Markdown
Member Author

Thanks @addaleax . Let's see how we can save domains!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell requested review from mcollina and trevnorris October 15, 2017 22:45
mcollina
mcollina reviewed Oct 16, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@mcollina mcollina Oct 16, 2017

Copy link
Copy Markdown
Member

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.

can you make this function a top-level function? Exposing it inside the prototype does not seem correct, as an external user could call it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 16, 2017

Copy link
Copy Markdown
Member Author

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.

Updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/domain.js Outdated

@mcollina mcollina Oct 16, 2017

Copy link
Copy Markdown
Member

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.

this will make every domain created register new async_hooks. I'm not 100% sure this is the intended usage, and what side effect it would create. cc @AndreasMadsen

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Oct 16, 2017

Copy link
Copy Markdown
Member

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.

Yeah, I think a Map that keeps track of the async id → domain mapping would be a better idea…

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 16, 2017

Copy link
Copy Markdown
Member Author

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.

Updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 16, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 16, 2017

Copy link
Copy Markdown
Member

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.

This won't work for async function promises. Set the property using resource.promise in the init-hook instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@TimothyGu TimothyGu Oct 16, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Be careful with #15673 if you do that though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@vdeturckheim vdeturckheim Oct 16, 2017

Copy link
Copy Markdown
Member Author

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.

Great pointer, thanks @AndreasMadsen

@TimothyGu is there any way to know if the promise has been init in such context?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Oct 16, 2017

Copy link
Copy Markdown
Member

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.

@vdeturckheim I think resource.promise instanceof Promise should be fine, it’s false for promises from other contexts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TimothyGu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@vdeturckheim vdeturckheim Oct 16, 2017

Copy link
Copy Markdown
Member Author

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.

it works, thanks @addaleax !

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 16, 2017

Copy link
Copy Markdown
Member Author

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.

Updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AndreasMadsen AndreasMadsen assigned AndreasMadsen and unassigned AndreasMadsen Oct 16, 2017
AndreasMadsen
AndreasMadsen reviewed Oct 16, 2017
View reviewed changes

@AndreasMadsen AndreasMadsen left a comment

Copy link
Copy Markdown
Member

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 would like to review this in detail but I don't have time right now. The comments made so far are worth addressing anyway.

Thanks for doing this.

PS: also remember to clean up in C++ land too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 22, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 22, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Would it not be possible to exit one domain and enter another, as in nested domains?

This kind of before and after pattern usually requires a stack, so I'm always suspicious when no stack is used.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 22, 2017

Copy link
Copy Markdown
Member Author

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.

Ack. Would make sense yes!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 22, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

Actually, I should even use domain.enter and domain.exit for before and after hooks. That would use the domain stack.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AndreasMadsen AndreasMadsen Oct 22, 2017

Copy link
Copy Markdown
Member

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.

Absolutely!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 22, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 22, 2017

Copy link
Copy Markdown
Member

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.

Just call createHook immediately, it is simpler. We do that for the the inspector integration and soon trace_events integration too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 22, 2017

Copy link
Copy Markdown
Member Author

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.

Good point!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 22, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 22, 2017

Copy link
Copy Markdown
Member

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.

Was the handle objects mutated before too?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 22, 2017

Copy link
Copy Markdown
Member Author

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 don't thinks so, it was made on request #16222 (comment)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AndreasMadsen AndreasMadsen Oct 22, 2017

Copy link
Copy Markdown
Member

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.

@addaleax could you explain why this is needed? I see no need to add extra domain complexity if it didn't already exist.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Oct 22, 2017

Copy link
Copy Markdown
Member

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.

@AndreasMadsen The thing is – it does already exist. With this, we can remove the code that sets it in other places, which would be very nice (look around for domain_string() in the source).

For event emitters (and therefore the handle wraps), the property is added in events.js, so we might need to come up with a better solution there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Oct 22, 2017

Copy link
Copy Markdown
Member

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.

Oh, by the way; this is essentially how MakeCallback kept track of the domain – by looking at the resource object’s .domain property

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AndreasMadsen AndreasMadsen Oct 22, 2017

Copy link
Copy Markdown
Member

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.

The thing is – it does already exist.

Okay, then it is fine. I thought it was only EventEmitter and Promise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Oct 22, 2017

Copy link
Copy Markdown
Member

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.

Yeah, those + all request types – that sums up everything in core …

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AndreasMadsen

AndreasMadsen commented Oct 22, 2017

Copy link
Copy Markdown
Member

It would be nice if we could remove https://github.com/nodejs/node/blob/master/src/node.cc#L1105L1278 at the very least DomainEnter, DomainExit, and promise setup should be removable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen

AndreasMadsen commented Oct 22, 2017

Copy link
Copy Markdown
Member

those linked to makeCallback: It seems there is some domain handling happening in native code I could not fix.

Yeah. It has always been a mystery to me, how domain managed to keep the context using only MakeCallback (before and after hooks).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vdeturckheim

vdeturckheim commented Oct 22, 2017

Copy link
Copy Markdown
Member Author

@AndreasMadsen agreed regarding c++ land. I am currently looking on how to have DomainsStackHasErrorHandler (https://github.com/nodejs/node/blob/master/src/node.cc#L1127) working with this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AndreasMadsen
AndreasMadsen reviewed Oct 24, 2017
View reviewed changes
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 24, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Move this to the Domain constructor, so require('domain') in itself doesn't slow us down. If the asyncHook is already enabled it will just be a noop. Hooks can only be enabled once.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AndreasMadsen AndreasMadsen added the async_hooks Issues and PRs related to the async hooks subsystem. label Oct 25, 2017
AndreasMadsen
AndreasMadsen reviewed Oct 25, 2017
View reviewed changes
Comment thread src/node.cc Outdated

@AndreasMadsen AndreasMadsen Oct 25, 2017

Copy link
Copy Markdown
Member

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.

We should be able to remove this too, including all uses of domain_array. As I see itset_domain_array is only used to set the domain property on resource object in C++. We now do that using async_hooks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 26, 2017

Copy link
Copy Markdown
Member Author

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.

Ack! good catch!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AndreasMadsen

AndreasMadsen commented Oct 25, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Those linked to makeCallback: It seems there is some domain handling happening in native code I could not fix.

I looked at addons/make-callback-recurse/test. I think we need to call domainEnter and domainExit when async_context_.async_id == 0 && env->using_domains() && !object_.IsEmpty(). This is to check for the domain property and set the active domain appropiately.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vdeturckheim

vdeturckheim commented Oct 26, 2017

Copy link
Copy Markdown
Member Author

@AndreasMadsen thanks for the pointers here. Seems to work now \o/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AndreasMadsen
AndreasMadsen approved these changes Oct 27, 2017
View reviewed changes

@AndreasMadsen AndreasMadsen left a comment

Copy link
Copy Markdown
Member

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’m pretty sure there are more things we can do but this is a really good first step.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/domain.js Outdated

@AndreasMadsen AndreasMadsen Oct 27, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Technically changing this to ES6 style classes is API breaking. We are likely going to land this in node 9 anyway so it shouldn't be a problem. Just as a note.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 27, 2017
View reviewed changes

@AndreasMadsen AndreasMadsen left a comment

Copy link
Copy Markdown
Member

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.

After a closer look, I think we can remove a little more.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/node.cc Outdated

@AndreasMadsen AndreasMadsen Oct 27, 2017

Copy link
Copy Markdown
Member

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.

Remove the domain_flag declaration from env.h and env-inl.h.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 29, 2017

Copy link
Copy Markdown
Member Author

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.

Should be good now

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/node.cc Outdated

@AndreasMadsen AndreasMadsen Oct 27, 2017

Copy link
Copy Markdown
Member

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 it was lost in a collapsed comment: we can remove all uses of domain_array. Just do a search for domain_array.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 29, 2017

Copy link
Copy Markdown
Member Author

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.

This should be good now. I cleaned up some domain related flags in multiple places ( 821f51d ) Hop I did not miss any

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AndreasMadsen AndreasMadsen Oct 29, 2017

Copy link
Copy Markdown
Member

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.

If it compiles without the domain_array definition I think it should be good :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/node.cc Outdated

@AndreasMadsen AndreasMadsen Oct 27, 2017

Copy link
Copy Markdown
Member

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 can't figure out what this array_buffer was actually used for before :/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 29, 2017

Copy link
Copy Markdown
Member Author

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'm not certain either. Seems to come from this PR #2022 . But could not really see in detail what it does.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/node.cc Outdated

@AndreasMadsen AndreasMadsen Oct 27, 2017

Copy link
Copy Markdown
Member

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 would like to understand why the returned caught boolean in process._fatalException is not enough to determine if we should abort on uncaughtException.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen reviewed Oct 29, 2017
View reviewed changes
Comment thread src/env.h Outdated

@AndreasMadsen AndreasMadsen Oct 29, 2017

Copy link
Copy Markdown
Member

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.

The DomainFlag type is no longer used. Can you remove the class

node/src/env.h

Line 466 in e3503ac

class DomainFlag {
:)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vdeturckheim vdeturckheim Oct 29, 2017

Copy link
Copy Markdown
Member Author

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.

Good catch!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AndreasMadsen
AndreasMadsen approved these changes Oct 29, 2017
View reviewed changes

@AndreasMadsen AndreasMadsen left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

LGTM again :)

I'm sure we can do more. But it doesn't have to be in one PR. I think it would be really nice to get the exception handling out of C++. I don't think we can do so much about the DomainBefore and DomainAfter parts, without breaking backward compatibility to some extent. But we should definitely consider doing too, it is not like we make it impossible to use domain with native addons, they can just use async_hooks :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vdeturckheim

vdeturckheim commented Oct 29, 2017

Copy link
Copy Markdown
Member Author

Awesome thanks!

Btw, do we want to update the depreciation status of the API in this PR too?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
http: remove domain specific code
e079247
Due to some changes to async tracking of http and also
in how domains are handled, it's no longer necessary
to manually copy domain from req to res in http code.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
timers: remove domain specific code
3962051
It is no longer necessary to explicitly set the handle
to inherit the Timeout domain.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
http: remove domain specific code
564d7e9
Due to some changes to async tracking of http and also
in how domains are handled, it's no longer necessary
to manually copy domain from req to res in http code.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
timers: remove domain specific code
944e2c2
It is no longer necessary to explicitly set the handle
to inherit the Timeout domain.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
http: remove domain specific code
935eac1
Due to some changes to async tracking of http and also
in how domains are handled, it's no longer necessary
to manually copy domain from req to res in http code.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
@apapirovski @MylesBorins
timers: remove domain specific code
146e8ac
It is no longer necessary to explicitly set the handle
to inherit the Timeout domain.

PR-URL: #18477
Refs: #16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
@apapirovski @MayaLekova
http: remove domain specific code
e2a8240
Due to some changes to async tracking of http and also
in how domains are handled, it's no longer necessary
to manually copy domain from req to res in http code.

PR-URL: nodejs#18477
Refs: nodejs#16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
@apapirovski @MayaLekova
timers: remove domain specific code
00ae73d
It is no longer necessary to explicitly set the handle
to inherit the Timeout domain.

PR-URL: nodejs#18477
Refs: nodejs#16222
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
@misterdjules misterdjules mentioned this pull request Oct 4, 2018
test: remove obsolete domain test #23252
Closed
2 tasks done
misterdjules pushed a commit that referenced this pull request Oct 5, 2018
Julien Gilli
test: remove obsolete domain test
a8526cb
test-microtask-queue-run-immediate-domain.js tests that the behavior of
another test, test-microtask-queue-run-immediate.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in
#1622 were merged, the core domain
module would replace the function that would call nextTick callbacks
with a different implementation.

This is no longer the case, and as such that test is no longer needed.

R-URL: #23252
Refs: #16222
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Oct 6, 2018
Julien Gilli @targos
test: remove obsolete domain test
9c84a64
test-microtask-queue-run-immediate-domain.js tests that the behavior of
another test, test-microtask-queue-run-immediate.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in
#1622 were merged, the core domain
module would replace the function that would call nextTick callbacks
with a different implementation.

This is no longer the case, and as such that test is no longer needed.

R-URL: #23252
Refs: #16222
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Oct 7, 2018
Julien Gilli @targos
test: remove obsolete domain test
a070842
test-microtask-queue-run-immediate-domain.js tests that the behavior of
another test, test-microtask-queue-run-immediate.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in
#1622 were merged, the core domain
module would replace the function that would call nextTick callbacks
with a different implementation.

This is no longer the case, and as such that test is no longer needed.

R-URL: #23252
Refs: #16222
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
misterdjules pushed a commit to misterdjules/node-1 that referenced this pull request Oct 9, 2018
Julien Gilli
test: remove obsolete domain test
2b57fb7
test-microtask-queue-integration-domain.js tests that the behavior of
another test, test-microtask-queue-integration.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in nodejs#16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.
@misterdjules misterdjules mentioned this pull request Oct 9, 2018
test: remove obsolete domain test #23342
Closed
2 tasks done
misterdjules pushed a commit to misterdjules/node-1 that referenced this pull request Oct 9, 2018
Julien Gilli
test: remove obsolete domain test
d82f855
test-microtask-queue-run-domain.js tests that the behavior of another
test, test-microtask-queue-run.js, is still consistent when the core
domain module is loaded.

This was needed because before the changes in nodejs#16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.
@misterdjules misterdjules mentioned this pull request Oct 9, 2018
test: remove obsolete domain test #23343
Closed
2 tasks done
misterdjules pushed a commit that referenced this pull request Oct 9, 2018
Julien Gilli
test: remove obsolete domain test
a3e604e
test-microtask-queue-integration-domain.js tests that the behavior of
another test, test-microtask-queue-integration.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in #16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.

PR-URL: #23342
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
misterdjules pushed a commit that referenced this pull request Oct 9, 2018
Julien Gilli
test: remove obsolete domain test
186ce7e
test-microtask-queue-run-domain.js tests that the behavior of another
test, test-microtask-queue-run.js, is still consistent when the core
domain module is loaded.

This was needed because before the changes in #16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.

PR-URL: #23343
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
Julien Gilli @jasnell
test: remove obsolete domain test
2270ae2
test-microtask-queue-run-immediate-domain.js tests that the behavior of
another test, test-microtask-queue-run-immediate.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in
#1622 were merged, the core domain
module would replace the function that would call nextTick callbacks
with a different implementation.

This is no longer the case, and as such that test is no longer needed.

R-URL: #23252
Refs: #16222
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
Julien Gilli @jasnell
test: remove obsolete domain test
ed6e4bc
test-microtask-queue-integration-domain.js tests that the behavior of
another test, test-microtask-queue-integration.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in #16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.

PR-URL: #23342
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
Julien Gilli @jasnell
test: remove obsolete domain test
e0f996c
test-microtask-queue-run-domain.js tests that the behavior of another
test, test-microtask-queue-run.js, is still consistent when the core
domain module is loaded.

This was needed because before the changes in #16222 were merged, the
core domain module would replace the function that would call nextTick
callbacks with a different implementation.

This is no longer the case, and therefore that test is no longer needed.

PR-URL: #23343
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@vdeturckheim vdeturckheim mentioned this pull request Dec 20, 2019
[async hooks] proposal for standard CLS API - request for feedback nodejs/diagnostics#345
Closed
@mikeconley12 mikeconley12 mentioned this pull request Aug 3, 2020
Async Local Storage for Request Context mikro-orm/mikro-orm#575
Closed
@AdriVanHoudt AdriVanHoudt mentioned this pull request May 21, 2021
Feature request: proper full hapi support getsentry/sentry-javascript#2172
Closed
abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this pull request May 5, 2024
Julien Gilli
test: remove obsolete domain test
b5e2e0c
test-microtask-queue-run-immediate-domain.js tests that the behavior of
another test, test-microtask-queue-run-immediate.js, is still
consistent when the core domain module is loaded.

This was needed because before the changes in
nodejs/node#1622 were merged, the core domain
module would replace the function that would call nextTick callbacks
with a different implementation.

This is no longer the case, and as such that test is no longer needed.

Refs: nodejs/node#16222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@addaleax addaleax addaleax approved these changes
@cjihrig cjihrig cjihrig approved these changes
@trevnorris trevnorris Awaiting requested review from trevnorris
+2 more reviewers
@AndreasMadsen AndreasMadsen AndreasMadsen approved these changes
@TimothyGu TimothyGu TimothyGu left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

async_hooks Issues and PRs related to the async hooks subsystem. domain Issues and PRs related to the domain subsystem. process Issues and PRs related to the process subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@vdeturckheim @addaleax @AndreasMadsen @mcollina @TimothyGu @cjihrig @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.