From ba58d8c7b447a646770d3f3ef0413184f1231ffb Mon Sep 17 00:00:00 2001 From: Ievgen Popovych Date: Fri, 18 Feb 2022 14:06:50 +0200 Subject: [PATCH] NO-JIRA: [Python] IO: Add ENETUNREACH to the list of tolerated errors ...which will enable reconnection logic to act in this case. ENETUNREACH can happen when target network is unreachable for example when the network stack was not fully initialized yet or when a network is not connected temporarily, etc. This makes ENETUNREACH handled just like EHOSTUNREACH (which is for some reason indicated with EINPROGRESS in this part of the code). Signed-off-by: Ievgen Popovych --- python/proton/_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/proton/_io.py b/python/proton/_io.py index 482f327955..b4e4449bea 100644 --- a/python/proton/_io.py +++ b/python/proton/_io.py @@ -65,7 +65,7 @@ def connect(addr) -> socket.socket: try: s.connect(addr[4]) except socket.error as e: - if e.errno not in (errno.EINPROGRESS, errno.EWOULDBLOCK, errno.EAGAIN): + if e.errno not in (errno.EINPROGRESS, errno.EWOULDBLOCK, errno.EAGAIN, errno.ENETUNREACH): raise return s