Try harder at handling connection timeouts for mirror-health
authorTollef Fog Heen <tfheen@err.no>
Thu, 1 Feb 2018 13:31:41 +0000 (14:31 +0100)
committerTollef Fog Heen <tfheen@err.no>
Thu, 1 Feb 2018 13:31:41 +0000 (14:31 +0100)
modules/roles/files/mirror_health/mirror-health

index c3606de..2c582f2 100755 (executable)
@@ -48,11 +48,11 @@ def check_uptodate():
             logging.debug("lm for host %s: %s", host, lm)
             if healthy(retrieve_from_host(host, HEALTH_CHECK_URL)):
                 latest_ts = max(latest_ts, lm)
-        except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout):
+        except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
             pass
     try:
         local_lm = last_modified(retrieve_from_host('localhost', URL))
-    except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout):
+    except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
         return False
     logging.debug("lm for localhost: %s", local_lm)
     if local_lm < latest_ts: