From 8ea70b60efac67f8b4ad4be8b8018a946f551d06 Mon Sep 17 00:00:00 2001 From: Satoshi Fujii Date: Wed, 13 Oct 2021 09:16:09 +0000 Subject: Fix pod become unready state The original implementation used Popen but its stdout pipe became clogged because the captured output was not processed properly. As a result, readiness check failed due to health-check server not responding and the pod became unready state. Signed-off-by: Satoshi Fujii Issue-ID: DCAEGEN2-2832 Change-Id: I98259e25fe40d5374a2c4236fc20bd631673f15e --- miss_htbt_service/check_health.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'miss_htbt_service/check_health.py') diff --git a/miss_htbt_service/check_health.py b/miss_htbt_service/check_health.py index a010b31..4d04210 100644 --- a/miss_htbt_service/check_health.py +++ b/miss_htbt_service/check_health.py @@ -57,9 +57,13 @@ class GetHandler(BaseHTTPRequestHandler): return -if __name__ == '__main__': +def start_health_check_server() -> None: from http.server import HTTPServer server = HTTPServer(("", 10002), GetHandler) print('Starting server at http://localhost:10002') server.serve_forever() + + +if __name__ == '__main__': + start_health_check_server() -- cgit 1.2.3-korg