Skip to content

Commit a2a680d

Browse files
committed
Merge pull request #671 from helgi/ticket_667
fix(app): catch connection timeout exceptions during appliation health verification
2 parents 3726a3f + 9603969 commit a2a680d

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)