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

Add a way to keep relaunching the payload process in case it exits #15

Open
probonopd opened this issue Jun 16, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@probonopd
Copy link
Member

probonopd commented Jun 16, 2021

Add a way to keep relaunching the payload process in case it exits with an exit code other than 0.

Use case:
launch --relaunch-on-exit Filer --desktop could be used in the startup script. If Filer crashes, it would get automatically restarted. (Reference: helloSystem/hello#172 (comment))

Note:
The time between two non-successful launches should double every time it is tried (to prevent from "respawning too fast" situations due to launch-crash-launch-crash loops).

  • Try to relaunch immediately after the payload process has exited with an exit code other than 0
  • In case the relaunch fails, wait for 2 seconds and retry
  • In case the relaunch fails again, wait for 4 seconds and retry
  • In case the relaunch fails again, wait for 8 seconds and retry
  • and so on
  • Once the relaunch succeeds and the payload application does not exit with an exit code other than 0 within a certain amount of time, reset the delay so that in case the application crashes again, the whole process starts again.

Is this a sensible behavior?

@probonopd probonopd added the enhancement New feature or request label Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant