Skip to content
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

process: load internal/async_hooks before inspector hooks registration #26866

Merged
merged 1 commit into from
Mar 23, 2019

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Mar 22, 2019

Otherwise the exports of internal/async_hooks may be undefined
when the inspector async hooks are registered.

Refs: #26859
Fixes: #26798

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@joyeecheung
Copy link
Member Author

@Trott Trott added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. process Issues and PRs related to the process subsystem. inspector Issues and PRs related to the V8 inspector protocol async_hooks Issues and PRs related to the async hooks subsystem. labels Mar 22, 2019
@joyeecheung
Copy link
Member Author

joyeecheung commented Mar 22, 2019

I found a setup in internal/async_hooks that makes the module non-side-effect free..not sure it's relevant, but I moved those bits out in bootstrap/node.js to make it more obvious. @Trott PTAL

@joyeecheung
Copy link
Member Author

@refack
Copy link
Contributor

refack commented Mar 22, 2019

New stress test: https://ci.nodejs.org/job/node-stress-single-test/2189/

That one was set to stress win10. This should be more relevant -
https://ci.nodejs.org/job/node-stress-single-test/2190/

@joyeecheung
Copy link
Member Author

BTW, this reminds me of..

// XXX(joyeecheung): for some reason this cannot be defined at the top-level
// and exported to be written to process._fatalException, it has to be
// returned as an *anonymous function* wrapped inside a factory function,
// otherwise it breaks the test-timers.setInterval async hooks test -
// this may indicate that node::FatalException should fix up the callback scope
// before calling into process._fatalException, or this function should
// take extra care of the async hooks before it schedules a setImmediate.

@joyeecheung
Copy link
Member Author

joyeecheung commented Mar 22, 2019

That one was set to stress win10. This should be more relevant -
https://ci.nodejs.org/job/node-stress-single-test/2190/

Right, I always forget that you need to check the box after the label..
Stress test for master with win2008r2-vs2017: https://ci.nodejs.org/job/node-stress-single-test/2191/


// XXX(joyeecheung): this has to be done after the initial load of
// `internal/async_hooks` otherwise `async_hooks` cannot require
// `internal/async_hooks`. Investigate why.
Copy link
Member

Choose a reason for hiding this comment

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

These three lines of comments can be removed now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the lines added above answers this question..the bug seems to lie in the module loading order or the scope resolution somehow. So I'd prefer to keep it until we figure out why..

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like the order of calling setupHooks is not the key here: https://ci.nodejs.org/job/node-stress-single-test/2192/ for cede98c is still green. (though it improves the spaghetti a bit..)

@Trott
Copy link
Member

Trott commented Mar 22, 2019

(Is it worth fast-tracking this?)

@joyeecheung
Copy link
Member Author

joyeecheung commented Mar 23, 2019

@Trott It should fix a flake that fails 18 out of 58 CI jobs, and it's rather trivial..so I guess it should be fine fast-tracking this.

For comparison:

This PR (green): https://ci.nodejs.org/job/node-stress-single-test/2190/
Master (red, 23 out of 100 failed): https://ci.nodejs.org/job/node-stress-single-test/2191/

cc @nodejs/testing please thumb this up if you are +1 to fast-tracking

@joyeecheung joyeecheung added the fast-track PRs that do not need to wait for 48 hours to land. label Mar 23, 2019
@Trott
Copy link
Member

Trott commented Mar 23, 2019

@nodejs/async_hooks Would be great to get this fast-tracked (see above comment) to fix a significant CI issue.

Otherwise the exports of `internal/async_hooks` may be undefined
when the inspector async hooks are registered.

PR-URL: nodejs#26866
Fixes: nodejs#26798
Refs: nodejs#26859
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@refack refack removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 23, 2019
@refack refack merged commit 0d21299 into nodejs:master Mar 23, 2019
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
Otherwise the exports of `internal/async_hooks` may be undefined
when the inspector async hooks are registered.

PR-URL: nodejs#26866
Fixes: nodejs#26798
Refs: nodejs#26859
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
Otherwise the exports of `internal/async_hooks` may be undefined
when the inspector async hooks are registered.

PR-URL: #26866
Fixes: #26798
Refs: #26859
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. fast-track PRs that do not need to wait for 48 hours to land. inspector Issues and PRs related to the V8 inspector protocol process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

investigate flaky test-inspect-async-hook-setup-at-inspect on Windows 2008r2 in CI
4 participants