Skip to content

Commit

Permalink
NO-JIRA: [Python] IO: Add ENETUNREACH to the list of tolerated errors
Browse files Browse the repository at this point in the history
...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 <ievgenp@seetrue.ai>
  • Loading branch information
Jmennius committed Apr 7, 2022
1 parent a920192 commit ba58d8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/proton/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ba58d8c

Please sign in to comment.