Skip to content

Commit

Permalink
survies_server_restart: ignore (verbosely) all socket errors
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Jan 27, 2024
1 parent 7a46fcc commit a40049b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions resalloc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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)
Expand Down

0 comments on commit a40049b

Please sign in to comment.