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