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

fix: requestSingleInstanceLock API sometimes hangs #33778

Merged
merged 1 commit into from Apr 21, 2022

Conversation

rzhao271
Copy link
Contributor

Description of Change

Backport of #33777
Fixes #33736

CC @nornagon @deepak1556

Checklist

Release Notes

Notes: Fixed an issue with the app.requestSingleInstanceLock() API where it would sometimes hang.

@rzhao271 rzhao271 requested review from a team as code owners April 13, 2022 23:36
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 13, 2022
@trop trop bot added 18-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Apr 13, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 13, 2022
Copy link
Contributor Author

@rzhao271 rzhao271 left a comment

Choose a reason for hiding this comment

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

I refactored the code a bit so that:

  • A user can now call ackCallback after doing a long-running operation, and we would be able to send back the ack successfully in that case.
  • The patch doesn't use separate StoreAck and SendBackAck functions. Instead, it uses just SendBackAck, and we create a new variable send_ack_ in electron_api_app to determine whether to send back the ack. When this variable is true, we will send back the ack, and the other application will read the ack. Otherwise, the ack will not be sent back, and the other application will not read the ack. This change should prevent getting blocked by unanswered ConnectNamedPipe calls.

Edit: These changes have been reverted so that we can merge in the original critical issue fix more quickly.

shell/browser/api/electron_api_app.cc Outdated Show resolved Hide resolved
@rzhao271 rzhao271 requested a review from nornagon April 15, 2022 22:15
@deepak1556 deepak1556 added backport-check-skip Skip trop's backport validity checking and removed backport This is a backport PR labels Apr 19, 2022
@zcbenz zcbenz merged commit ffb8749 into electron:18-x-y Apr 21, 2022
@release-clerk
Copy link

release-clerk bot commented Apr 21, 2022

Release Notes Persisted

Fixed an issue with the app.requestSingleInstanceLock() API where it would sometimes hang.

VerteDinde added a commit that referenced this pull request May 8, 2022
VerteDinde added a commit that referenced this pull request May 19, 2022
VerteDinde added a commit that referenced this pull request May 23, 2022
…ngleInstanceLock()` flow (#34295)

* Revert "fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778)"

This reverts commit ffb8749.

* fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"

* chore: update patch
VerteDinde added a commit that referenced this pull request May 23, 2022
…ngleInstanceLock()` flow (#34295)

* Revert "fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778)"

This reverts commit ffb8749.

* fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"

* chore: update patch
codebytere pushed a commit that referenced this pull request May 23, 2022
…Lock() flow (#34312)

fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow (#34295)

* Revert "fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778)"

This reverts commit ffb8749.

* fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"

* chore: update patch
@rzhao271 rzhao271 deleted the rzhao271/connect-patch-fix branch October 27, 2022 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
18-x-y backport-check-skip Skip trop's backport validity checking semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants