-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: unload native addons when the environment is destroyed #24861
src: unload native addons when the environment is destroyed #24861
Conversation
bc80971
to
5e44c8b
Compare
@joyeecheung I have addressed your review comments. @bnoordhuis I have addressed your review comments. I put the body of |
Originally from portions of nodejs#23319.
This is an alternative to nodejs#23319 which attaches the loaded addons to the environment and closes them when the environment is destroyed.
5e44c8b
to
df7aa7a
Compare
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.
Thank you! 💙
bbea5f8
to
584f643
Compare
Failure looks legit. |
Resume, just to see if it's 100% reproducible: |
Fresh CI rather than Resume Build so that it pulls in the fact that a bunch of tests are currently marked flaky: https://ci.nodejs.org/job/node-test-pull-request/19572/ |
Any chance that this AIX failure is related? 16:58:17 not ok 2208 addons/at-exit/test
16:58:17 ---
16:58:17 duration_ms: 0.723
16:58:17 severity: crashed
16:58:17 exitcode: -4
16:58:17 stack: |-
16:58:17 ... I'm guessing not, but you tell me. ¯\(ツ)/¯ In the meantime, Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/19573/ |
@Trott I’m not sure whether we should wait for the outcome of the resume build (run stress tests if it comes back green?), but before/after stress tests with a hundred runs or so might be helpful? |
I guess if we're going to tie up an AIX machine for a few hours doing a stress test, this is the time of day/week to do it, so here we go: Stress test on master: https://ci.nodejs.org/job/node-stress-single-test/2128/ Stress test on this PR: https://ci.nodejs.org/job/node-stress-single-test/2129/ |
CI Resume Build for AIX showed the same addons failure. https://ci.nodejs.org/job/node-test-commit-aix/19762/nodes=aix61-ppc64/console 18:59:40 not ok 2208 addons/at-exit/test
18:59:40 ---
18:59:40 duration_ms: 0.918
18:59:40 severity: crashed
18:59:40 exitcode: -4
18:59:40 stack: |-
18:59:40 ... Still awaiting stress test for this PR to start, but stress test on master is clean so far after almost 900 runs. (It's set to do 1000.) |
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.
Stress test is crashing on addons/at-exit/test 100% of the time after 400+ runs on AIX. Impressed/weirded-out that this issue is AIX only. But I guess it needs to be sorted out before landing...
20:22:34 not ok 1 addons/at-exit/test
20:22:34 ---
20:22:34 duration_ms: 0.573
20:22:34 severity: crashed
20:22:34 exitcode: -4
20:22:34 stack: |-
20:22:34 ...
This change broke the It seems that is was somehow related to nan? Fix landed in nan and awaiting a release nodejs/nan#831 Would someone be willing to open a backport so we can track the progress? |
@MylesBorins This seems very unlikely … can you double-check and maybe share how you tested this?
That PR was opened before this one landed and the contents seem very much unrelated… |
Originally from portions of nodejs#23319. PR-URL: nodejs#24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This is an alternative to nodejs#23319 which attaches the loaded addons to the environment and closes them when the environment is destroyed. PR-URL: nodejs#24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Originally from portions of #23319. Backport-PR-URL: #25258 PR-URL: #24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This is an alternative to #23319 which attaches the loaded addons to the environment and closes them when the environment is destroyed. Backport-PR-URL: #25258 PR-URL: #24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Originally from portions of nodejs#23319. PR-URL: nodejs#24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This is an alternative to nodejs#23319 which attaches the loaded addons to the environment and closes them when the environment is destroyed. PR-URL: nodejs#24861 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This has been backported and released in v11.7.0 but it turned out that this actually breaks node-report. Therefore I am going to remove the backport again and release v11.7.1 without this. |
I’m sorry that I did not add a test case for the issue we’re seeing with node-report when I wrote the original PR at #23319 – I’ve opened #25577 to address it. (This does not mean that this is not a bug in |
If it's something we can improve, please report/submit a PR over in https://github.com/nodejs/node-report. Note that one of the issues with addons and |
@richardlau I can try to do that, but given the work on integrating it into core in #22712, I don’t think I’d personally want to spend much time on the npm module… the first problem I encountered here is that (Also, it’s absolutely understandable if you’re not interested in going through the nearly one thousand comments in #22712, but there’s a lot in there that applies to the npm module as well, including this issue iirc.) |
Unloading native addons from the main thread was an (presumably unintended) significant breaking change, because addons may rely on their memory being available after an `Environment` exits. This patch only restricts this to Worker threads, at least for the time being, and thus matches the behaviour from nodejs#23319. Refs: nodejs#24861 Refs: nodejs#23319
Unloading native addons from the main thread was an (presumably unintended) significant breaking change, because addons may rely on their memory being available after an `Environment` exits. This patch only restricts this to Worker threads, at least for the time being, and thus matches the behaviour from #23319. PR-URL: #25577 Refs: #24861 Refs: #23319 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Unloading native addons from the main thread was an (presumably unintended) significant breaking change, because addons may rely on their memory being available after an `Environment` exits. This patch only restricts this to Worker threads, at least for the time being, and thus matches the behaviour from #23319. PR-URL: #25577 Refs: #24861 Refs: #23319 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This is an alternative to #23319
which attaches the loaded addons to the environment and closes them
when the environment is destroyed.
It includes the test/addons/worker-addon,
test/addons/hello-world/test-worker.js and the documentation update from the original PR written
by @addaleax in a separate commit.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes