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

Implemented restart retrying #102

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

tiomny
Copy link

@tiomny tiomny commented Apr 23, 2023

This autoheal container watches for unhealthy containers and sends a restart command to unhealthy container when finds some.
However, sometimes that container starts and fails again, or it fails to restart.
This patch adds an ability to look after restarting container until it restarts successfully.
AUTOHEAL_RETRIES container parameter was also introduced for maximum restart attempts.

@modem7
Copy link
Collaborator

modem7 commented Sep 15, 2023

I would argue that if the container keeps on retrying, there's typically an underlying issue with the container itself, and not just a temporary condition.

Could you give an example where this has been an issue for you?

@tiomny
Copy link
Author

tiomny commented Sep 15, 2023

In my case this is the HomeAssistant container. It crashes for some external reason, and the original Autoheal fails to restart it.
More details: external reason is a VPN container, which restarts once a day. Its warm-up time might be a bit longer than HomeAssistant's, that's why HA crashes immediately after start.
I put my changes directly into Autoheal and it restarts HA successfully at 2-3 attempt.

I would say that VPN might be offline temporarily for different reasons and my case is just a small individual case.

@tiomny tiomny mentioned this pull request Sep 15, 2023
@leleobhz
Copy link
Collaborator

I would argue that if the container keeps on retrying, there's typically an underlying issue with the container itself, and not just a temporary condition.

Could you give an example where this has been an issue for you?

I generically can state race conditions with services - including other services healed by autoheal. A case is a webservice with healthcheck that leads on database connection and the database also dies.

Also, this PR may need to be refreshed from main branch.

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.

None yet

3 participants