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(app-shell-odd): quit the app when the render process is killed. #15500

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Jun 24, 2024

Overview

While investigating an issue with the ODD, we noticed that the ODD electron app (opentrons-robot-app.service) continues to run even when the render process is killed for whatever reason. If we ever get into this state, we should quit the application so that the service exits and systemd can restart the service. This pull request goes in conjunction with this oe-core pr Opentrons/oe-core#152.

Test Plan

  • Make sure that the application exits when the render process is killed
  • Make sure that the opentrons-robot-app.service exits and restarts when the renderer is killed

Changelog

  • Quit the electron app when we get a render-process-gone event

Review requests

  • Makes sense?
  • Any other times the renderer can be killed that we don't want this to happen, ie we have another window that gets closed or something?

Risk assessment

Low, this should only happen when the renderer is killed.

@vegano1 vegano1 marked this pull request as ready for review June 24, 2024 22:09
@vegano1 vegano1 requested a review from a team as a code owner June 24, 2024 22:09
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

Looks like you need to make format-js, but otherwise LGTM!

app-shell-odd/src/main.ts Outdated Show resolved Hide resolved
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Very nice! This also might make restarting the app with systemd a lot faster.

@vegano1
Copy link
Contributor Author

vegano1 commented Jun 25, 2024

Very nice! This also might make restarting the app with systemd a lot faster.

Not by itself, we needed to add 'TimeoutStopSec=10' in this oe-core pr to achieve that.

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

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

thanks @vegano1!

can we also log the cause of the render process crashing? from the PR:

* `event` Event
* `details` Object
  * `reason` String - The reason the render process is gone.  Possible values:
    * `clean-exit` - Process exited with an exit code of zero
    * `abnormal-exit` - Process exited with a non-zero exit code
    * `killed` - Process was sent a SIGTERM or otherwise killed externally
    * `crashed` - Process crashed
    * `oom` - Process ran out of memory
    * `launch-failure` - Process never successfully launched
    * `integrity-failure` - Windows code integrity checks failed

https://github.com/electron/electron/pull/23096/files

@vegano1 vegano1 merged commit ce86430 into edge Jun 26, 2024
20 checks passed
@vegano1 vegano1 deleted the quit-app-when-renderer-dies branch June 26, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants