diff options
author | Kotresh HR <khiremat@redhat.com> | 2017-10-06 22:42:43 -0400 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2017-10-11 10:16:09 +0000 |
commit | b56bdb34dafd1a87c5bbb2c9a75d1a088d82b1f4 (patch) | |
tree | a592eeae5762d5ed86b15ab505584dc2135d09e2 | |
parent | 3edf926a1bda43879c09694cf3904c214c94c9dc (diff) |
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 <khiremat@redhat.com>
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 13 |
1 files 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 |