Skip to content

Conversation

@addaleax
Copy link
Member

Backporting #14040, the first commit is a clean cherry-pick (but should be squashed together with its friend).

/cc @nodejs/async_hooks and in particular @AndreasMadsen

@addaleaxaddaleax added addons Issues and PRs related to native addons. async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. v8.x labels Jul 6, 2017
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. v8.x labels Jul 6, 2017
@addaleaxaddaleax added the semver-minor PRs that contain new features and should be released in the next minor version. label Jul 6, 2017
@refack
Copy link
Contributor

I would love to see just the squashed tests be run on v8.1.3...
So I'm thinking of a way to "retroactively" (metaphorically) add the tests to before the change. Maybe by splitting the two commits to code & tests, then squash the tests and rebase so they are the first commit (or even a separate PR).
But I'm not sure it worth messing up the commits.

@addaleax
Copy link
MemberAuthor

I would love to see just the squashed tests be run on v8.1.3...

I mean, it’s not like you can’t do that already. I’ll try if I find the time, but you know, you have the same tools in front of me that I have ;)

@refack
Copy link
Contributor

I would love to see just the squashed tests be run on v8.1.3...

I mean, it’s not like you can’t do that already. I’ll try if I find the time, but you know, you have the same tools in front of me that I have ;)

Yes, also I assume they pass, I'm more thinking out loud about adding a regression test ad-hoc...
I'd be happy to do it if we agree it's worth messing with the commit order (since b14a1af424b0d4cc4ff3c9077f3eb70f73ee9d03 lands smoothly) ⚖️

@AndreasMadsen
Copy link
Member

I would love to see just the squashed tests be run on v8.1.3...

Besides containing some API changes, this also contains an important fix to AsyncHooksGetTriggerAsyncId so the tests won't pass.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these not in node.cc?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason, except maybe that it kind of belongs to the rest of the legacy code here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All MakeCallback functions are in node.cc including the legacy ones. But since this won't land in master I don't care that much.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be async_id? Not that it really matters.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I can change it if you like. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EmitAsyncInit that returns async_id requires 4 parameters, correct? Or is this a test for the async_context casting?

Also, is node::async_uid by purpose?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EmitAsyncInit that returns async_id requires 4 parameters, correct? Or is this a test for the async_context casting?

Yes, the latter. The old one is not really exposed through our API anymore, it’s just the symbol that has to keep being exported so already-compiled libraries can reference it.

Also, is node::async_uid by purpose?

Yes, everywhere else in the tests we use async_id now, so there should be one place where we don’t.

Copy link
Member

@AndreasMadsenAndreasMadsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have a few questions but I think it is correct.

I don't have skills to review the ABI stuff, someone else should do that. The logic itself looks fine.

src/node.h Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not deprecate these too?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for pointing that out.

AndreasMadsenand others added 3 commits July 11, 2017 20:05
* Fix AsyncHooksGetTriggerAsyncId such it corresponds to async_hooks.triggerAsyncId and not async_hooks.initTriggerId. * Use an async_context struct instead of two async_uid values. This change was necessary since the fixing AsyncHooksGetTriggerAsyncId otherwise makes it impossible to get the correct default trigger id. It also prevents an invalid triggerAsyncId in MakeCallback. * Rename async_uid to async_id for consistency * Rename get_uid to get_async_id * Add get_trigger_async_id to AsyncResource class PR-URL: nodejs#14040 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
@addaleaxaddaleaxforce-pushed the v8.x-async-wrap-cpp-overhaul branch from 3409631 to a2f61c4CompareJuly 11, 2017 18:05
@addaleax
Copy link
MemberAuthor

addaleax pushed a commit that referenced this pull request Jul 12, 2017
* Fix AsyncHooksGetTriggerAsyncId such it corresponds to async_hooks.triggerAsyncId and not async_hooks.initTriggerId. * Use an async_context struct instead of two async_uid values. This change was necessary since the fixing AsyncHooksGetTriggerAsyncId otherwise makes it impossible to get the correct default trigger id. It also prevents an invalid triggerAsyncId in MakeCallback. * Rename async_uid to async_id for consistency * Rename get_uid to get_async_id * Add get_trigger_async_id to AsyncResource class PR-URL: #14040 Backport-PR-URL: #14109 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Andreas Madsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
@addaleax
Copy link
MemberAuthor

Landed in c7fb1ff

@addaleaxaddaleax deleted the v8.x-async-wrap-cpp-overhaul branch July 12, 2017 13:41
addaleax pushed a commit that referenced this pull request Jul 18, 2017
* Fix AsyncHooksGetTriggerAsyncId such it corresponds to async_hooks.triggerAsyncId and not async_hooks.initTriggerId. * Use an async_context struct instead of two async_uid values. This change was necessary since the fixing AsyncHooksGetTriggerAsyncId otherwise makes it impossible to get the correct default trigger id. It also prevents an invalid triggerAsyncId in MakeCallback. * Rename async_uid to async_id for consistency * Rename get_uid to get_async_id * Add get_trigger_async_id to AsyncResource class PR-URL: #14040 Backport-PR-URL: #14109 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Andreas Madsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
* Fix AsyncHooksGetTriggerAsyncId such it corresponds to async_hooks.triggerAsyncId and not async_hooks.initTriggerId. * Use an async_context struct instead of two async_uid values. This change was necessary since the fixing AsyncHooksGetTriggerAsyncId otherwise makes it impossible to get the correct default trigger id. It also prevents an invalid triggerAsyncId in MakeCallback. * Rename async_uid to async_id for consistency * Rename get_uid to get_async_id * Add get_trigger_async_id to AsyncResource class PR-URL: #14040 Backport-PR-URL: #14109 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Andreas Madsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
@addaleaxaddaleax mentioned this pull request Jul 21, 2017
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addonsIssues and PRs related to native addons.async_hooksIssues and PRs related to the async hooks subsystem.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.semver-minorPRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@addaleax@refack@AndreasMadsen@jasnell@nodejs-github-bot