From b5cbc370781417cda449ba008c747ccf6d9794b9 Mon Sep 17 00:00:00 2001 From: Chi Lo Date: Wed, 2 Sep 2020 13:58:26 -0700 Subject: [PATCH] Fix pod not restarted when issue detected Service pod which fails connection, timed out, or unexpected error during health probing should return with error status. Change-Id: I26795a9f421fbdc84e75501b729da043b898c994 --- ranger/templates/bin/_health-probe.py.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ranger/templates/bin/_health-probe.py.tpl b/ranger/templates/bin/_health-probe.py.tpl index 1c1b99ff..824b9533 100644 --- a/ranger/templates/bin/_health-probe.py.tpl +++ b/ranger/templates/bin/_health-probe.py.tpl @@ -66,10 +66,13 @@ def run_health_check(): except requests.exceptions.ConnectionError as ce: sys.stderr.write("Health probe ConnectionError Exp:%s\n" % str(ce)) + sys.exit(1) except requests.exceptions.ReadTimeout as to: sys.stderr.write("Health probe ReadTimeout Exp:%s\n" % str(to)) + sys.exit(1) except Exception as ex: sys.stderr.write("Health probe UnExpected Exp:%s\n" % str(ex)) + sys.exit(1) def check_pid_running(pid):