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-13 04:57:17 -0700
commitf443a73b6088298da13a2ca1fee9db72215c8f84 (patch)
tree511f63939c4f5bd63d9593320f32309aca041f36
parent74eb7b4e6bb091123720c4e225208523a424f9c8 (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. > 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> BUG: 1374595 Change-Id: I9cfce116e8aafa4a98654f5190d40a455af8ec95 Signed-off-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit c0f877c0374d97e0bee17aac4850d7655a35e61b) Reviewed-on: http://review.gluster.org/15443 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: Saravanakumar Arumugam <sarumuga@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 acbd49e..6341de5 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: