Skip to content

Commit 9603969

Browse files
committed
fix(app): catch connection timeout exceptions during appliation health verification
1 parent 3726a3f commit 9603969

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

rootfs/api/models/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,12 @@ def verify_application_health(self, **kwargs):
458458
# Uses time module to account for the timout value of 3 seconds
459459
start = time.time()
460460
for _ in range(10):
461-
# http://docs.python-requests.org/en/master/user/advanced/#timeouts
462-
response = session.get(url, timeout=req_timeout)
461+
try:
462+
# http://docs.python-requests.org/en/master/user/advanced/#timeouts
463+
response = session.get(url, timeout=req_timeout)
464+
except requests.exceptions.ConnectTimeout:
465+
# We are fine with timeouts, lets keep trying
466+
continue
463467

464468
# 30 second timeout (timout per request * 10)
465469
if (time.time() - start) > (req_timeout * 10):

0 commit comments

Comments
 (0)