From 3afbe4201d864d2e886509f5633468aa344fa444 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 6 Oct 2017 06:02:56 -0400 Subject: 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 --- geo-replication/syncdaemon/resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit