From 2bae008bb178011c2507d112fa9ea798660e7f2f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 16 Jan 2015 13:22:54 -0500 Subject: [PATCH] Add a timeout to the health check on the registry workers --- endpoints/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endpoints/web.py b/endpoints/web.py index c1ce6abbc..fb08ea60e 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -167,7 +167,7 @@ def health(): port = ':' + hostname_parts[1] registry_url = '%s://localhost%s/v1/_internal_ping' % (app.config['PREFERRED_URL_SCHEME'], port) - registry_healthy = client.get(registry_url, verify=False).status_code == 200 + registry_healthy = client.get(registry_url, verify=False, timeout=2).status_code == 200 check = HealthCheck.get_check(app.config['HEALTH_CHECKER'][0], app.config['HEALTH_CHECKER'][1]) (data, is_healthy) = check.conduct_healthcheck(db_healthy, buildlogs_healthy, registry_healthy)