summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-09-01 12:35:46 +0530
committerAravinda VK <avishwan@redhat.com>2016-09-08 09:14:48 -0700
commitc0f877c0374d97e0bee17aac4850d7655a35e61b (patch)
tree2b429fb527e9fb0a5cfb7d88eeab5ce09fecbb25
parentcd23242b8953040b231f402c334f16520ac8029f (diff)
geo-rep: Fix logging sync failures
If Rsync/Tar subprocess dies, while logging error Geo-rep fails with EBADF while accessing error file. Also worker dies while accessing elines before it is set. BUG: 1372193 Change-Id: I9cfce116e8aafa4a98654f5190d40a455af8ec95 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/15379 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r--geo-replication/syncdaemon/resource.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 00bf4cb9d5c..ddbf19688c5 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -169,7 +169,13 @@ class Popen(subprocess.Popen):
except ValueError: # file is already closed
time.sleep(0.5)
continue
- l = os.read(fd, 1024)
+
+ try:
+ l = os.read(fd, 1024)
+ except OSError:
+ time.sleep(0.5)
+ continue
+
if not l:
continue
tots = len(l)
@@ -204,6 +210,7 @@ class Popen(subprocess.Popen):
kw['close_fds'] = True
self.lock = threading.Lock()
self.on_death_row = False
+ self.elines = []
try:
sup(self, args, *a, **kw)
except: