From b56bdb34dafd1a87c5bbb2c9a75d1a088d82b1f4 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 6 Oct 2017 22:42:43 -0400 Subject: geo-rep: Add ENODATA to retry list on gfid getxattr During xsync crawl, worker occasionally crashed with ENODATA on getting gfid from backend. This is not persistent and is transient. Worker restart invovles re-processing of few entries in changenlogs. So adding ENODATA to retry list to avoid worker restart. Change-Id: Ib78d1e925c0a83c78746f28f7c79792a327dfd3e BUG: 1499391 Signed-off-by: Kotresh HR --- geo-replication/syncdaemon/resource.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 45106af2c85..0ca023cd8c5 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -348,17 +348,14 @@ class Server(object): @classmethod @_pathguard def gfid(cls, path): - try: - buf = Xattr.lgetxattr(path, cls.GFID_XATTR, 16) + buf = errno_wrap(Xattr.lgetxattr, [path, cls.GFID_XATTR, 16], + [ENOENT], [ESTALE, ENODATA]) + if buf == ENOENT: + return buf + else: m = re.match('(.{8})(.{4})(.{4})(.{4})(.{12})', "".join( ['%02x' % x for x in struct.unpack(cls.GFID_FMTSTR, buf)])) return '-'.join(m.groups()) - except (IOError, OSError): - ex = sys.exc_info()[1] - if ex.errno == ENOENT: - return ex.errno - else: - raise @classmethod @_pathguard -- cgit