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

Revert "embedding: make Stop() stop Workers" #32623

Closed
wants to merge 2 commits into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Apr 2, 2020

Revert "embedding: make Stop() stop Workers"

This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. stop_sub_worker_contexts() needs to be called on the
thread on which the Environment is currently running, it’s not
thread-safe. The current API requires Stop() to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as FreeEnvironment() will also stop Workers,
which is commonly the next action on an Environment instance after
having Stop() called on it.

Refs: #32531

src,test: add regression test for nested Worker termination

This adds a regression test for terminating a Worker inside which
another Worker is running.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

addaleax added 2 commits April 2, 2020 23:40
This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. `stop_sub_worker_contexts()` needs to be called on the
thread on which the `Environment` is currently running, it’s not
thread-safe. The current API requires `Stop()` to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as `FreeEnvironment()` will also stop Workers,
which is commonly the next action on an `Environment` instance after
having `Stop()` called on it.

Refs: nodejs#32531
This adds a regression test for terminating a Worker inside which
another Worker is running.
@nodejs-github-bot nodejs-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. labels Apr 2, 2020
@addaleax addaleax added embedding Issues and PRs related to embedding Node.js in another project. worker Issues and PRs related to Worker support. c++ Issues and PRs that require attention from people who are familiar with C++. and removed 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. labels Apr 2, 2020
@addaleax addaleax added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 2, 2020
@addaleax
Copy link
Member Author

addaleax commented Apr 2, 2020

Fast-track?

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 3, 2020
@nodejs-github-bot
Copy link
Collaborator

addaleax added a commit that referenced this pull request Apr 3, 2020
This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. `stop_sub_worker_contexts()` needs to be called on the
thread on which the `Environment` is currently running, it’s not
thread-safe. The current API requires `Stop()` to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as `FreeEnvironment()` will also stop Workers,
which is commonly the next action on an `Environment` instance after
having `Stop()` called on it.

Refs: #32531

PR-URL: #32623
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
addaleax added a commit that referenced this pull request Apr 3, 2020
This adds a regression test for terminating a Worker inside which
another Worker is running.

PR-URL: #32623
Refs: #32531
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@addaleax
Copy link
Member Author

addaleax commented Apr 3, 2020

Landed in 7947811...e629366

@addaleax addaleax closed this Apr 3, 2020
@addaleax addaleax deleted the revert-stop-workers branch April 3, 2020 02:33
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. `stop_sub_worker_contexts()` needs to be called on the
thread on which the `Environment` is currently running, it’s not
thread-safe. The current API requires `Stop()` to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as `FreeEnvironment()` will also stop Workers,
which is commonly the next action on an `Environment` instance after
having `Stop()` called on it.

Refs: #32531

PR-URL: #32623
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
This adds a regression test for terminating a Worker inside which
another Worker is running.

PR-URL: #32623
Refs: #32531
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Apr 12, 2020
This adds a regression test for terminating a Worker inside which
another Worker is running.

PR-URL: #32623
Refs: #32531
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
addaleax added a commit that referenced this pull request Feb 18, 2021
This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. `stop_sub_worker_contexts()` needs to be called on the
thread on which the `Environment` is currently running, it’s not
thread-safe. The current API requires `Stop()` to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as `FreeEnvironment()` will also stop Workers,
which is commonly the next action on an `Environment` instance after
having `Stop()` called on it.

Refs: #32531

PR-URL: #32623
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
addaleax added a commit that referenced this pull request Feb 18, 2021
This adds a regression test for terminating a Worker inside which
another Worker is running.

PR-URL: #32623
Refs: #32531
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@addaleax
Copy link
Member Author

addaleax commented Feb 18, 2021

I added this to v12.x-staging because people were reporting this bug occurring in v12.20.1, and it's a change that should definitely land everywhere where the original bug was also introduced. /cc @nodejs/lts

richardlau pushed a commit that referenced this pull request Feb 22, 2021
This reverts commit 037ac99.

As flaky CI failures have revealed, this feature was implemented
incorrectly. `stop_sub_worker_contexts()` needs to be called on the
thread on which the `Environment` is currently running, it’s not
thread-safe. The current API requires `Stop()` to be thread-safe,
though.

We could add a new API for this, but unless there’s demand, that’s
probably not necessary as `FreeEnvironment()` will also stop Workers,
which is commonly the next action on an `Environment` instance after
having `Stop()` called on it.

Refs: #32531

PR-URL: #32623
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
richardlau pushed a commit that referenced this pull request Feb 22, 2021
This adds a regression test for terminating a Worker inside which
another Worker is running.

PR-URL: #32623
Refs: #32531
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@richardlau richardlau mentioned this pull request Mar 18, 2021
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. c++ Issues and PRs that require attention from people who are familiar with C++. embedding Issues and PRs related to embedding Node.js in another project. fast-track PRs that do not need to wait for 48 hours to land. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants