summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-10-06 06:02:56 -0400
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-12 18:27:13 +0000
commite57c81fa658d180e4f70c68bea205a89b7497615 (patch)
tree142060f810508afefe593b70deac9a843fb7af09
parent417088fbac3e44d87802cfc988a51e2ad7968d70 (diff)
geo-rep: Add ENOTSUP error to retry list
os.listdir gives ENOTSUP on gfid path occasionally which is not persistant. Adding it to retry list to avoid worker to crash if it's transient error. > Change-Id: Ic795dd1f02a27c9e5d901e20722ee32451838feb > BUG: 1499180 > Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit 3afbe4201d864d2e886509f5633468aa344fa444) Change-Id: Ic795dd1f02a27c9e5d901e20722ee32451838feb BUG: 1500396 Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r--geo-replication/syncdaemon/resource.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index a6e351590f8..45106af2c85 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -23,6 +23,7 @@ import logging
import tempfile
import threading
import subprocess
+import errno
from errno import EEXIST, ENOENT, ENODATA, ENOTDIR, ELOOP, EACCES
from errno import EISDIR, ENOTEMPTY, ESTALE, EINVAL, EBUSY, EPERM
from select import error as SelectError
@@ -49,6 +50,7 @@ UrlRX = re.compile('\A(\w+)://([^ *?[]*)\Z')
HostRX = re.compile('[a-zA-Z\d](?:[a-zA-Z\d.-]*[a-zA-Z\d])?', re.I)
UserRX = re.compile("[\w!\#$%&'*+-\/=?^_`{|}~]+")
+ENOTSUP = getattr(errno, 'ENOTSUP', 'EOPNOTSUPP')
def sup(x, *a, **kw):
"""a rubyesque "super" for python ;)
@@ -677,7 +679,7 @@ class Server(object):
return
names = []
- names = errno_wrap(os.listdir, [path], [ENOENT], [ESTALE])
+ names = errno_wrap(os.listdir, [path], [ENOENT], [ESTALE, ENOTSUP])
if isinstance(names, int):
return