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 supervisor for automatic server restart #25

Closed
wants to merge 1 commit into from
Closed

Add supervisor for automatic server restart #25

wants to merge 1 commit into from

Conversation

alejandrosame
Copy link
Member

This PR provides a solution for issue #4.

By introducing supervisor, the Flask app can now be restarted when it fails, instead of directly finishing the docker container. The pushed configuration tries to restart the app a total of 35 times. In its current state, supervisor delays every retry by 1 second. This means:

  • a delay of 1 second for the first retry and a delay of 35 seconds on the last retry.
  • a total of 10.5 min delay from first try to last try before supervisor gives up relaunching the app.
  • after the last retry, supervisor gives up restarting the app. Currently, this leaves the container running without crashing (as supervisor process keeps running), but with the Flask server down indefinitely, unless manually started.

If this approach is accepted, a follow-up PR with a workaround still needs to be added to restart the app once supervisor gives up restarting it, as suggested by Supervisor/supervisor#487 (comment). This is needed to keep the retry delays reasonable and on an infinite loop.

@alejandrosame
Copy link
Member Author

Cleaning up PRs

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.

1 participant