-
Notifications
You must be signed in to change notification settings - Fork 15k
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
fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously #20632
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me!
cc @loc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking while I go back to my remote repro cases and check this, I believe the synchronous nature is required for race condition handling
Also this doesn't fix the root cause of #20086 it just hides the underlying issue |
To add some background here:The However later there was some changes in Chromium that, the new page is pre-loaded before the old page gets destroyed, so race condition would happen even though the message was sent synchronously. The race condition was then fixed by passing the ID of current context with the So technically the Also some note on how remote references are cleared:Currently we have 2 ways of clearing remote references: one is listening to Both ways are required because |
For the original issue #20086, before IPC module got migrated to mojo, the |
7111346
to
c71763d
Compare
I have added tests to ensure the remote references can be cleared for all cases (on navigation and on There is still problem that |
I have to agree with @MarshallOfSound - this is just fixing piecemeal and sweeping under the carpet the underlying issue. After we've patched this particular sendSync (about a month or so ago - see #20350) we've been hitting slew of IPC deadlock issues in other situations. |
@lkonstantinov This PR is not pretending to be fixing the root cause, it's fixing #20086. The change to use an async IPC could have been made sooner as a refactoring as it does not have to be sync anymore as @zcbenz explained. |
@MarshallOfSound Can you take another look of this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the old repro cases are fine with this change, thinking it through it should be OK. I don't want this PR to close the referenced issue though. All this does is minimize, it doesn't fix it.
I'm merging this and keeping the original issue open. |
Release Notes Persisted
|
I was unable to backport this PR to "6-1-x" cleanly; |
I was unable to backport this PR to "7-0-x" cleanly; |
Description of Change
Fixes parts of #20086 by sending
ELECTRON_BROWSER_CONTEXT_RELEASE
asynchronously.The synchronous send was added in #9389, which was necessary back then as we didn't have a unique identifier for each JS context.
Fixing
ipcRenderer.sendSync()
to not hang when the mojo connection is lost is also important, but more complicated.Checklist
npm test
passesRelease Notes
Notes: Fixed hang when closing a scriptable popup window using the
remote
module.