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

src: restrict unloading addons to Worker threads #25577

Closed
wants to merge 2 commits into from

Conversation

addaleax
Copy link
Member

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.

Refs: #24861
Refs: #23319

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 18, 2019
@addaleax addaleax added the addons Issues and PRs related to native addons. label Jan 18, 2019
@addaleax
Copy link
Member Author

addaleax commented Jan 18, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/20205/ (:heavy_check_mark:)

Please 👍 this comment to approve fast-tracking – it fixes a regression in 11.7.0.

/cc @MylesBorins @BridgeAR

@addaleax addaleax added the fast-track PRs that do not need to wait for 48 hours to land. label Jan 18, 2019
@addaleax addaleax removed the fast-track PRs that do not need to wait for 48 hours to land. label Jan 21, 2019
@addaleax
Copy link
Member Author

This needs a second review. (/cc @nodejs/workers maybe?)

refack
refack previously approved these changes Jan 21, 2019
@refack refack dismissed their stale review January 21, 2019 17:46

Code LGTM, but I don't feel knowledgeable enough in this area.

src/env.cc Show resolved Hide resolved
test/addons/worker-addon/binding.cc Outdated Show resolved Hide resolved
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
@addaleax addaleax force-pushed the addon-unload-main-thread branch from a6186f8 to d7d409a Compare January 22, 2019 22:16
@addaleax
Copy link
Member Author

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 22, 2019
@addaleax
Copy link
Member Author

addaleax commented Jan 23, 2019

Windows failure looks weird.

Rebuild: https://ci.nodejs.org/job/node-test-commit-windows-fanned/24153/ (✔️ )

@danbev
Copy link
Contributor

danbev commented Jan 23, 2019

Landed in ef1c639.

@danbev danbev closed this Jan 23, 2019
danbev pushed a commit that referenced this pull request Jan 23, 2019
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]>
@addaleax addaleax deleted the addon-unload-main-thread branch January 23, 2019 16:05
addaleax added a commit that referenced this pull request Jan 23, 2019
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]>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. 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++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants