From 3a2ae0066f85e0f25ff59d0fab281c23d918e9fa Mon Sep 17 00:00:00 2001
From: Kotresh HR <khiremat@redhat.com>
Date: Tue, 28 Jul 2015 14:37:47 +0530
Subject: [PATCH 254/279] geo-rep: Do not crash worker on ESTALE
Handle ESTALE returned by lstat gracefully
by retrying it. Do not crash the worker.
BUG: 1239075
Change-Id: Iad983f43923aa2ed809aa29cc55a76bcbeb96472
Reviewed-on: http://review.gluster.org/11772
Reviewed-on: http://review.gluster.org/11820
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/55052
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
Tested-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
---
geo-replication/syncdaemon/syncdutils.py | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py
index b565ec6..3feadb8 100644
--- a/geo-replication/syncdaemon/syncdutils.py
+++ b/geo-replication/syncdaemon/syncdutils.py
@@ -489,15 +489,7 @@ def errno_wrap(call, arg=[], errnos=[], retry_errnos=[]):
def lstat(e):
- try:
- return os.lstat(e)
- except (IOError, OSError):
- ex = sys.exc_info()[1]
- if ex.errno == ENOENT:
- return ex.errno
- else:
- raise
-
+ return errno_wrap(os.lstat, [e], [ENOENT], [ESTALE])
class NoPurgeTimeAvailable(Exception):
pass
--
1.7.1