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

[v12.x backport] async_hooks: add executionAsyncResource #32131

Conversation

puzpuzpuz
Copy link
Member

@puzpuzpuz puzpuzpuz commented Mar 6, 2020

Backports executionAsyncResource into v12.x. I've cherry picked the following commits/PRs:

Had to resolve only a single (minor) conflict in lib/internal/async_hooks.js -> emitBeforeScript.

cc @Qard @vdeturckheim @addaleax @Flarna

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

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. v12.x labels Mar 6, 2020
@puzpuzpuz
Copy link
Member Author

puzpuzpuz commented Mar 7, 2020

It looks like CI failed due to timeout in compilation phase. I've just tried a fresh compilation and a test run on this branch and they went fine on my machine.

Could someone restart Travis build?

@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/29605/

@targos targos added the semver-minor PRs that contain new features and should be released in the next minor version. label Mar 7, 2020
@Flarna
Copy link
Member

Flarna commented Mar 7, 2020

Could you please add links to the originial PRs in the PR description?

@puzpuzpuz
Copy link
Member Author

Could you please add links to the originial PRs in the PR description?

Sure thing. I've updated the description.

@puzpuzpuz
Copy link
Member Author

Failed tests look weird and unrelated with this PR. Are there known flaky tests in v12.x-staging or I'm wrong and those failures are relevant?

@nodejs-github-bot
Copy link
Collaborator

@puzpuzpuz
Copy link
Member Author

As far as I can see, failed tests (at least, some of them) are related with #32080. Namely, this regular expression has to be fixed now, as CHANGELOG.md has changed in master:
https://github.com/nodejs/node/blob/v12.x-staging/tools/doc/versions.js#L58

Should I cherry pick that PR as well or it's better to create a separate PR to backport those changes?

Also, it seems that test/parallel/test-dgram-connect* and test/parallel/test-dgram-send* tests are failing on OS X 10.15 (and only there), but I'm not sure what to do with those. They may be flaky, or there may be a fix that wasn't backported yet.

@targos
Copy link
Member

targos commented Mar 7, 2020

I've seen the test-dgram errors on other PRs against the master branch.

@richardlau
Copy link
Member

I've seen the test-dgram errors on other PRs against the master branch.

I don't think #31936 has landed on v12.x-staging yet.

@richardlau richardlau mentioned this pull request Mar 8, 2020
3 tasks
@puzpuzpuz
Copy link
Member Author

puzpuzpuz commented Mar 8, 2020

I've created #32146 to deal with test failures discussed above. We have to wait for it to land first before we get a green build here.

@puzpuzpuz puzpuzpuz changed the title [v12.x] async_hooks: backport executionAsyncResource to v12.x [v12.x backport] async_hooks: add executionAsyncResource Mar 8, 2020
@puzpuzpuz puzpuzpuz force-pushed the execution-async-resource-backport branch from 21223ff to 838907d Compare March 14, 2020 19:49
@puzpuzpuz
Copy link
Member Author

puzpuzpuz commented Mar 14, 2020

I just did a rebase, as #32146 was merged today. Hopefully, CI builds should be able to pass successfully now.

Could someone trigger a CI build on this one?

@puzpuzpuz puzpuzpuz force-pushed the execution-async-resource-backport branch from 838907d to 96b06a9 Compare March 15, 2020 12:09
@puzpuzpuz
Copy link
Member Author

Rebased and resolved a minor conflict (appeared after 0b3bee5).

@puzpuzpuz
Copy link
Member Author

puzpuzpuz commented Mar 15, 2020

I'm seeing the following error in make -j4 test output after the rebase:

Running JS linter...
/home/puzpuzpuz/projects/node/tools/doc/allhtml.js:87
  if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`);
                          ^

Error: link not found: repl_reverse_i_search
    at Object.<anonymous> (/home/puzpuzpuz/projects/node/tools/doc/allhtml.js:87:33)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    ...
    at internal/main/run_main_module.js:18:47
Makefile:754: recipe for target 'out/doc/api/all.html' failed

Looks like the issue is not related with this PR and located in v12.x-staging (see #32280 (comment)).

Update. Looks like the problem is the following. #31256 was backported, but it included this this change which depends on #31006 (and this PR wasn't backported). I've created #32282 to deal with that.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@puzpuzpuz
Copy link
Member Author

puzpuzpuz commented Mar 17, 2020

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2310/

Overall this needs to be watched carefully as it might introduce regressions.

Thanks for running a CITGM build. The changes in this PR may introduce some regressions, indeed.

I can see 20 failures in this build, but I'm not sure if they're related with this PR or they're false positives. I can see that other CITGM builds also fail with similar (if not the same) errors.

Update. I went thought failed tests output and didn't find anything suspicious: they seem to be failing because of some timeouts and flaky tests.

@mcollina
Copy link
Member

@Trott @MylesBorins could you take a look as well?

@Trott
Copy link
Member

Trott commented Mar 22, 2020

CITGM results look good to me.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@puzpuzpuz
Copy link
Member Author

Rebased to the latest v12.x-staging

@nodejs-github-bot
Copy link
Collaborator

@Flarna
Copy link
Member

Flarna commented Apr 6, 2020

Not sure if backporting to LTS should be delayed a little as breaking API changes are in pipeline (#31950).

@puzpuzpuz
Copy link
Member Author

@Flarna

Not sure if backporting to LTS should be delayed a little as breaking API changes are in pipeline (#31950).

Those changes are about ALS, while this PR backports executionAsyncResounce only.

@Qard
Copy link
Member

Qard commented Apr 6, 2020

Yep. That change should not impact this. Also, I would argue to not consider it breaking as ALS is experimental and still very new. I think we should consider those changes not major and therefore backportable.

@Flarna
Copy link
Member

Flarna commented Apr 6, 2020

yes, sorry. mixed this up.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30515/

mcollina and others added 4 commits April 14, 2020 10:41
Remove the need for the destroy hook in the basic APM case.

Co-authored-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: nodejs#30959
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Ensure that resource returned by executionAsyncResource() in before
and after hook matches that resource causing this before/after calls.

PR-URL: nodejs#31821
Refs: nodejs#30959
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
PR-URL: nodejs#31944
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This was an oversight in 9fdb6e6.
Fixing this is necessary to make `executionAsyncResource()` work
as expected.

Refs: nodejs#30959
Fixes: nodejs#32060

PR-URL: nodejs#32063
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@puzpuzpuz puzpuzpuz force-pushed the execution-async-resource-backport branch from d8de7e5 to fc50e29 Compare April 14, 2020 07:41
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member

targos commented Apr 25, 2020

Landed on my release preparation branch: https://github.com/targos/node/commits/prepare-minor

@targos targos closed this Apr 25, 2020
@puzpuzpuz puzpuzpuz deleted the execution-async-resource-backport branch April 26, 2020 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs 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.