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