From 2f64b6f59d5562996e681d08842e2af347a3dafc Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sat, 27 Jan 2024 09:15:48 +0100 Subject: [PATCH] survies_server_restart: ignore (verbosely) all socket errors Relates: https://github.com/fedora-copr/copr/pull/3113 --- resalloc/client.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/resalloc/client.py b/resalloc/client.py index 3db5530..1826320 100644 --- a/resalloc/client.py +++ b/resalloc/client.py @@ -23,15 +23,6 @@ class _WrappedXMLRPCClient(object): def __init__(self, connection_string, survive_server_restart): self._conn = C_XMLRPC(connection_string) self.survive_server_restart = survive_server_restart - self._retry_errors = [ - errno.ECONNREFUSED, - errno.ECONNABORTED, - errno.ECONNRESET, - errno.ENETUNREACH, - errno.ENETRESET, - errno.ENETDOWN, - errno.EADDRNOTAVAIL, - ] def call(self, name, *args): """ @@ -43,11 +34,10 @@ def call(self, name, *args): while True: try: return fcall(*args) - except socket.error as os_e: + except socket.error as sock_err: + print(str(sock_err), file=sys.stderr) if not self.survive_server_restart: raise - if os_e.errno not in self._retry_errors: - raise except RPCEXCEPTION as ex: print(str(ex), file=sys.stderr) time.sleep(3)