Skip to content

HTTP 503 response bypasses num_retries #19

@bfosberry

Description

@bfosberry

When num_retries is specified, regardless of whether the number of retries has been met, the service will be restarted if the http check gets a 503 back. The following log is from a check with -r 10

2024/04/23 22:39:06 [mysql5306_check] Received TICK_5 event from supervisor
2024/04/23 22:39:07 [mysql5306_check] No processes in state RUNNING found for process mysql5306
2024/04/23 22:39:11 [mysql5306_check] Received TICK_5 event from supervisor
2024/04/23 22:39:11 [mysql5306_check] Performing `http` check for process name mysql5306
2024/04/23 22:39:11 [mysql5306_check] HTTPCheck: Querying URL http://127.0.0.1:7035/check for process mysql5306
2024/04/23 22:39:11 [mysql5306_check] HTTPCheck: Status contacting URL http://127.0.0.1:7035/check for process mysql5306: 503 Service Unavailable
2024/04/23 22:39:11 [mysql5306_check] HTTPCheck: Check failed: Bad HTTP status code: 503
2024/04/23 22:39:11 [mysql5306_check] `http` check failed for process mysql5306. Trying to restart.
2024/04/23 22:39:11 [mysql5306_check] Trying to stop process mysql5306
2024/04/23 22:39:11 [mysql5306_check] Stopped process mysql5306
2024/04/23 22:39:11 [mysql5306_check] Starting process mysql5306
2024/04/23 22:39:15 [mysql5306_check] Received TICK_5 event from supervisor
2024/04/23 22:39:16 [mysql5306_check] No processes in state RUNNING found for process mysql5306
2024/04/23 22:39:21 [mysql5306_check] Received TICK_5 event from supervisor
2024/04/23 22:39:22 [mysql5306_check] Performing `http` check for process name mysql5306
2024/04/23 22:39:22 [mysql5306_check] HTTPCheck: Querying URL http://127.0.0.1:7035/check for process mysql5306
2024/04/23 22:39:22 [mysql5306_check] HTTPCheck: Status contacting URL http://127.0.0.1:7035/check for process mysql5306: 503 Service Unavailable
2024/04/23 22:39:22 [mysql5306_check] HTTPCheck: Check failed: Bad HTTP status code: 503
2024/04/23 22:39:22 [mysql5306_check] `http` check failed for process mysql5306. Trying to restart.
2024/04/23 22:39:22 [mysql5306_check] Trying to stop process mysql5306

My expectation here is that even with a 503 or connection refused response, the check would honor the retries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions