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

refactor: try just using regular [Sync] for MessageSync #20797

Merged
merged 2 commits into from Dec 17, 2019
Merged

Conversation

nornagon
Copy link
Member

@nornagon nornagon commented Oct 29, 2019

Description of Change

This aligns us closer with how Mojo expects to work, and as a bonus fixes some tricky race conditions that can happen if the browser process closes its end of the mojo pipe while we're waiting for a synchronous response.

Checklist

Release Notes

Notes: none

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Oct 29, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Oct 30, 2019
@nornagon
Copy link
Member Author

This seems to be passing CI... could it be that we've removed our need for synchronous IPC to be well-ordered w.r.t asynchronous IPC?

Copy link
Member

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tests pass this time because lots of tests have been moved to main process.

This might still cause problems with remote module:

win = remote.getCurrentWindow()
win = null && gc()  // async DereferenceRemoteJSObject sent to main process
win = remote.getCurrentWindow() // sync GetGlobal sent to main process
// DereferenceRemoteJSObject handled, remote reference cleared
// win now references to non-exist remote object.

@nornagon
Copy link
Member Author

Hm, I don't think the scenario you laid out would be a problem in the usual case. The only time that sync calls will be reordered with respect to async calls is if the main process is waiting on a sync call, which almost never happens. We previously observed some issues relating to window close, because there's a compositor shutdown call that the browser invokes synchronously during window close. If I recall correctly, it was because we were triggering synchronous calls during window close to release objects, which I don't think is the case any more? But you're right that we're exercising the remote module a lot less.

Copy link
Member

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification, I'm good with the change then.

@nornagon
Copy link
Member Author

Let's merge this and see how it goes. We can always revert if we discover issues.

@nornagon nornagon merged commit 54b4756 into master Dec 17, 2019
@release-clerk
Copy link

release-clerk bot commented Dec 17, 2019

No Release Notes

@trop
Copy link
Contributor

trop bot commented Jan 14, 2020

@MarshallOfSound has manually backported this PR to "7-1-x", please check out #21776

@miniak
Copy link
Contributor

miniak commented Jan 27, 2020

@nornagon what about 8-x-y? should it be back-ported there as well?

@nornagon
Copy link
Member Author

it should.

@MarshallOfSound want to do the honors?

@trop
Copy link
Contributor

trop bot commented Jan 28, 2020

@erickzhao has manually backported this PR to "8-x-y", please check out #21948

jkleinsc pushed a commit that referenced this pull request Jan 29, 2020
)

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
@sofianguy sofianguy added this to Fixed in 8.0.0-beta.8 in 8.2.x Jan 29, 2020
@sofianguy sofianguy added this to Fixed in 7.1.10 in 7.2.x Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
7.2.x
Fixed in 7.1.10
8.2.x
Fixed in 8.0.0-beta.8
Development

Successfully merging this pull request may close these issues.

None yet

4 participants