diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-09-01 12:35:46 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-09-14 23:28:51 -0700 |
commit | 0da3b27e1483a55a63511b4c851f4f1f14c9eacd (patch) | |
tree | 1661cf08e6a8a3e221d2b55df29b6c1100f309ac /geo-replication/syncdaemon | |
parent | 538ae4f3a0127103e0b163eb8b009eb9f89d9f26 (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: 1374596
Change-Id: I9cfce116e8aafa4a98654f5190d40a455af8ec95
Signed-off-by: Aravinda VK <avishwan@redhat.com>
(cherry picked from commit c0f877c0374d97e0bee17aac4850d7655a35e61b)
Reviewed-on: http://review.gluster.org/15442
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 818dc6b39a5..db20fabeecc 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -170,7 +170,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) @@ -205,6 +211,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: |