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: ensure no more platform foreground tasks after Deinit #25653

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@addaleax
Copy link
Member

addaleax commented Jan 23, 2019

Node first calls Isolate::Dispose, then NodePlatform::UnregisterIsolate.
This again calls PerIsolatePlatformData::Shutdown, which (before this
patch) called FlushForegroundTasksInternal, which might call
RunForegroundTask if it finds foreground tasks to be executed. This
will fail however, since Isolate::GetCurrent was already reset during
Isolate::Dispose.
Hence remove the check to FlushForegroundTasksInternal and add checks
instead that no more foreground tasks are scheduled.

Refs: v8#86

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
src: ensure no more platform foreground tasks after Deinit
Node first calls `Isolate::Dispose`, then
`NodePlatform::UnregisterIsolate`.
This again calls `PerIsolatePlatformData::Shutdown`, which (before this
patch) called `FlushForegroundTasksInternal`, which might call
`RunForegroundTask` if it finds foreground tasks to be executed. This
will fail however, since `Isolate::GetCurrent` was already reset during
`Isolate::Dispose`.
Hence remove the check to `FlushForegroundTasksInternal` and add checks
instead that no more foreground tasks are scheduled.

Refs: v8#86
@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 23, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 24, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Jan 27, 2019

Landed in bafd808

@addaleax addaleax closed this Jan 27, 2019

@addaleax addaleax deleted the addaleax:pick-v8-platform-deinit branch Jan 27, 2019

addaleax added a commit that referenced this pull request Jan 27, 2019

src: ensure no more platform foreground tasks after Deinit
Node first calls `Isolate::Dispose`, then
`NodePlatform::UnregisterIsolate`.
This again calls `PerIsolatePlatformData::Shutdown`, which (before this
patch) called `FlushForegroundTasksInternal`, which might call
`RunForegroundTask` if it finds foreground tasks to be executed. This
will fail however, since `Isolate::GetCurrent` was already reset during
`Isolate::Dispose`.
Hence remove the check to `FlushForegroundTasksInternal` and add checks
instead that no more foreground tasks are scheduled.

Refs: v8#86

PR-URL: #25653
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

addaleax added a commit that referenced this pull request Jan 28, 2019

src: ensure no more platform foreground tasks after Deinit
Node first calls `Isolate::Dispose`, then
`NodePlatform::UnregisterIsolate`.
This again calls `PerIsolatePlatformData::Shutdown`, which (before this
patch) called `FlushForegroundTasksInternal`, which might call
`RunForegroundTask` if it finds foreground tasks to be executed. This
will fail however, since `Isolate::GetCurrent` was already reset during
`Isolate::Dispose`.
Hence remove the check to `FlushForegroundTasksInternal` and add checks
instead that no more foreground tasks are scheduled.

Refs: v8#86

PR-URL: #25653
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

@targos targos referenced this pull request Jan 29, 2019

Merged

v11.9.0 proposal #25802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment