Skip to content

Commit

Permalink
Fix RETRYABLE list with errno values
Browse files Browse the repository at this point in the history
This will ensure same logic for different Os
  • Loading branch information
cgalibern committed Feb 11, 2020
1 parent 512c999 commit 5149e1e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import time
import select
import sys
from errno import ECONNREFUSED, EPIPE, EBUSY, EALREADY


class DummyException(Exception):
pass
Expand Down Expand Up @@ -48,12 +50,12 @@ def to_bytes(x):
ConnectionResetError = DummyException
ConnectionRefusedError = DummyException

# add ECONNRESET, ENOTFOUND, ESOCKETTIMEDOUT, ETIMEDOUT, ECONNREFUSED, EHOSTUNREACH, EPIPE ?
# add ECONNRESET, ENOTFOUND, ESOCKETTIMEDOUT, ETIMEDOUT, EHOSTUNREACH ?
RETRYABLE = (
11, # EBUSY
32, # EPIPE
146, # EREFUSED
149, # EALREADY
EBUSY,
EPIPE,
ECONNREFUSED,
EALREADY,
)
SOCK_TMO = 1.0
PAUSE = 0.2
Expand Down

0 comments on commit 5149e1e

Please sign in to comment.