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,worker: ensure code after exit() effectless #45620

Merged
merged 5 commits into from
Dec 25, 2022

Conversation

ywave620
Copy link
Contributor

Cope with the delay(to the next function call) of v8::Isolate::TerminateExecution()

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Nov 25, 2022
@@ -12,6 +12,7 @@ const { Worker } = require('worker_threads');
const workerData = new Int32Array(new SharedArrayBuffer(4));
const w = new Worker(`
const { createHook } = require('async_hooks');
const { workerData } = require('worker_threads');
Copy link
Contributor Author

@ywave620 ywave620 Nov 25, 2022

Choose a reason for hiding this comment

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

I believe the original author forgot to add this import. And this is why the strictEqual below paased, because adding to the workerData raises an reference exception.

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 26, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 26, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 27, 2022
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/45620
✔  Done loading data for nodejs/node/pull/45620
----------------------------------- PR info ------------------------------------
Title      process,worker: ensure code followed by exit() effectless (#45620)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     ywave620:ensure-exit -> nodejs:main
Labels     process, author ready, needs-ci
Commits    1
 - process,worker: ensure code followed by exit() effectless
Committers 1
 - ywave620 
PR-URL: https://github.com/nodejs/node/pull/45620
Reviewed-By: Anna Henningsen 
Reviewed-By: Yagiz Nizipli 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/45620
Reviewed-By: Anna Henningsen 
Reviewed-By: Yagiz Nizipli 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 25 Nov 2022 07:56:35 GMT
   ✔  Approvals: 2
   ✔  - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/45620#pullrequestreview-1194537461
   ✔  - Yagiz Nizipli (@anonrig): https://github.com/nodejs/node/pull/45620#pullrequestreview-1194617601
   ✖  Last GitHub CI failed
   ℹ  Last Full PR CI on 2022-11-26T10:52:29Z: https://ci.nodejs.org/job/node-test-pull-request/48195/
- Querying data for job/node-test-pull-request/48195/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/3557316810

@nodejs-github-bot nodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Nov 27, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()
@ywave620 ywave620 changed the title process,worker: ensure code followed by exit() effectless process,worker: ensure code after exit() effectless Nov 28, 2022
@ywave620
Copy link
Contributor Author

spurious failure

[ RUN      ] InspectorSocketTest.HostIPv6NonRoutable
../test/cctest/test_inspector_socket.cc:323: Failure
Value of: (!expectation.read_expected)
  Actual: true
Expected: false

ignore exception that indicaties a termination in napi call
@ywave620
Copy link
Contributor Author

ywave620 commented Dec 10, 2022

@daeyeon daeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 10, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 10, 2022
@nodejs-github-bot
Copy link
Collaborator

env->isolate->ThrowException(value);
}

// i.e. whether v8 exited or is about to exit
inline bool terminatedOrTerminating() {
return this->isolate->IsExecutionTerminating() || !can_call_into_js();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that if this->isolate->IsExecutionTerminating() is true, we can not call can_call_into_js(), because that will extract the node::Environment by calling v8 API on this->isolate , which will again hit the assertion:

# Fatal error in ../deps/v8/src/api/api.cc, line 8635
# Debug check failed: !i_isolate->is_execution_terminating().

@daeyeon daeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 12, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 12, 2022
@nodejs-github-bot
Copy link
Collaborator

@ywave620 ywave620 requested review from addaleax and aduh95 and removed request for addaleax December 25, 2022 03:05
@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Dec 25, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 25, 2022
@nodejs-github-bot nodejs-github-bot merged commit 8438f3b into nodejs:main Dec 25, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 8438f3b

targos pushed a commit that referenced this pull request Jan 1, 2023
Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()

PR-URL: #45620
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Jan 2, 2023
RafaelGSS pushed a commit that referenced this pull request Jan 4, 2023
Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()

PR-URL: #45620
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Jan 5, 2023
Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()

PR-URL: #45620
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
juanarbol pushed a commit that referenced this pull request Jan 26, 2023
Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()

PR-URL: #45620
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@juanarbol juanarbol mentioned this pull request Jan 28, 2023
juanarbol pushed a commit that referenced this pull request Jan 31, 2023
Cope with the delay(to the next function call) of
v8::Isolate::TerminateExecution()

PR-URL: #45620
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants