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

inspector: turn platform tasks that outlive Agent into no-ops #30031

Closed
wants to merge 3 commits into from

Conversation

@addaleax
Copy link
Member

addaleax commented Oct 18, 2019

Turn tasks scheduled on the v8::Isolate or on the given platform
into no-ops if the underlying MainThreadInterface has gone away
before the task could be run (which would happen when the
Environment instance and with it the inspector::Agent instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasks execution, and the
execution of RequestInterrupt() callbacks (although
the former two always happen in the same order in our own code).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).
@nodejs-github-bot

This comment has been minimized.

@eugeneo

This comment has been minimized.

Copy link
Contributor

eugeneo commented Oct 18, 2019

I’m reviewing from the phone so I am not sure if I captured the details of the change. It looks like this is the scenario where MainThreadHeandle is supposed to be used... I will try to do a better review this weekend.

@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Oct 18, 2019

@eugeneo Take your time :)

I’m not sure how MainThreadHandle would be usable here, though.

Copy link
Contributor

eugeneo left a comment

Thank you for looking into this!

src/inspector/main_thread_interface.cc Outdated Show resolved Hide resolved
@nodejs-github-bot

This comment has been minimized.

Copy link
Member

codebytere left a comment

lgtm :)

@nodejs-github-bot

This comment has been minimized.

src/inspector/main_thread_interface.cc Outdated Show resolved Hide resolved
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

addaleax added a commit that referenced this pull request Oct 23, 2019
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).

PR-URL: #30031
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Oct 23, 2019

Landed in 7a82e5e

@addaleax addaleax closed this Oct 23, 2019
@addaleax addaleax deleted the addaleax:inspector-task-lifetime branch Oct 23, 2019
targos added a commit that referenced this pull request Oct 24, 2019
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).

PR-URL: #30031
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@targos targos mentioned this pull request Nov 5, 2019
targos added a commit that referenced this pull request Nov 8, 2019
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).

PR-URL: #30031
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos added a commit that referenced this pull request Nov 10, 2019
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).

PR-URL: #30031
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos added a commit that referenced this pull request Nov 11, 2019
Turn tasks scheduled on the `v8::Isolate` or on the given platform
into no-ops if the underlying `MainThreadInterface` has gone away
before the task could be run (which would happen when the
`Environment` instance and with it the `inspector::Agent` instance
are destroyed).

This addresses an issue that Electron has been having with
inspector support, and generally just seems like the right thing
to do, as we may not fully be in control of the relative timing
of Environment teardown, platform tasksexecution, and the
execution of `RequestInterrupt()` callbacks (although
the former two always happen in the same order in our own code).

PR-URL: #30031
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.