★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/25577Nouvelle recherche | Portail wanayoo
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

Copy link
Member

@addaleax addaleax commented Jan 18, 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.

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

@addaleax addaleax requested a review from gabrielschulhof Jan 18, 2019
@nodejs-github-bot nodejs-github-bot added the c++ label Jan 18, 2019
@addaleax addaleax added the addons label Jan 18, 2019
@addaleax addaleax mentioned this pull request Jan 18, 2019
@addaleax
Copy link
Member Author

@addaleax addaleax commented Jan 18, 2019

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

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

/cc @MylesBorins @BridgeAR

@addaleax addaleax added the fast-track label Jan 18, 2019
@addaleax addaleax removed the fast-track label Jan 21, 2019
@addaleax
Copy link
Member Author

@addaleax addaleax commented Jan 21, 2019

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

refack
refack previously approved these changes Jan 21, 2019
@refack refack dismissed their stale review Jan 21, 2019

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
addaleax added 2 commits Jan 22, 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
nodejs#23319.

Refs: nodejs#24861
Refs: nodejs#23319
@addaleax
Copy link
Member Author

@addaleax addaleax commented Jan 22, 2019

@addaleax addaleax added the author ready label Jan 22, 2019
@addaleax
Copy link
Member Author

@addaleax addaleax commented Jan 23, 2019

Windows failure looks weird.

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

@danbev
Copy link
Member

@danbev danbev commented Jan 23, 2019

Landed in ef1c639.

@danbev danbev closed this Jan 23, 2019
danbev pushed a commit that referenced this issue 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 <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@addaleax addaleax deleted the addon-unload-main-thread branch Jan 23, 2019
addaleax added a commit that referenced this issue 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 <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@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 author ready c++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants