Skip to content

Restart "always" should restart unhealthy and running containers. #49161

Open
@arfar-x

Description

Description

Hey,
There are some cases that unhealthy containers keep running and would not exit with a non-zero status code.

According to the documentation:

Always restart the container if it stops. If it's manually stopped, it's restarted only when Docker daemon restarts or the container itself is manually restarted.

It is not obviously mentioned what would happen to running Unhealthy containers.

Scenario:
I have a Python Celery project run by command celery -A run.celery worker. Celery keeps running when facing a connection timeout/loss or any failure and keeps retrying based on its configurations.
I have set the healthcheck command to celery -A run.celery inspect ping, so it would be considered unhealthy when this command exists with a non-zero status code, meanwhile the worker is still running but coping with a failure.

The point is, restart policy "always" does not restart the containers when they are considered Unhealthy by healthcheck command.

We expect the restart policy 'always' to restart the container not just when it stops but also when it enters an unhealthy state as defined by the health check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    kind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shinystatus/0-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions