supervisor_checks icon indicating copy to clipboard operation
supervisor_checks copied to clipboard

HTTP 503 response bypasses num_retries

Open bfosberry opened this issue 10 months ago • 0 comments

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.

bfosberry avatar Apr 23 '24 22:04 bfosberry