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
revert: add first-instance-ack event to the app.requestSingleInstanceLock()
flow
#34297
Conversation
…ngleInstanceLock()` flow"
API LGTM |
@VerteDinde has manually backported this PR to "18-x-y", please check out #34295 |
app.requestSingleInstanceLock()
flow"app.requestSingleInstanceLock()
flow
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.
API LGTM
WOA failure is a flake and unrelated |
Release Notes Persisted
|
I was unable to backport this PR to "19-x-y" cleanly; |
@VerteDinde has manually backported this PR to "19-x-y", please check out #34312 |
…eLock()` flow (electron#34297) fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"
Description of Change
Closes #33566
PR #31460 added a new
first-instance ack
event, which uses named pipes under the hood. However, named pipes are not session-specific like the window and mutex objects that are used to synchronize/communicate between processes. Because of this, pipes meant for one app will collide with another and cause a deadlock. (A fix for this was attempted in #34139)Even after making the named pipes session-specific, there is still a race condition where if multiple "second instances" of different Electron apps (or of the same app) run at the same time, they could get acks meant for other ones. This means that two Electrons apps with the same name, being used by the same user, could collide as long as one us using Electron 18+. We were also seeing this issue with a single Electron app creating a second instance, such as an HTML notification window.
There's a plan to refactor this to move away from named pipes and use MessageWindow instead (see #34235). Because Electron 19 is close to stable release, and more users will be upgrading to both Electron 19 and Electron 18, we've decided to revert the original named pipe change and reland a future refactor using MessageWindow. This PR reverts the original change.
Checklist
npm test
passesRelease Notes
Notes: Notes: Fixed an issue where running second instances of the same application would cause a deadlock on Windows.