summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-05-05 14:26:05 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-08 02:19:59 -0700
commitbb4091e67a23ac83b1d8fe5a3a3db45549faac67 (patch)
tree2203732a21eb2bac58bcf310b06d9fa792cd5977 /geo-replication/syncdaemon
parenteee703473f17e3784e15dba291cc3df00fde9f96 (diff)
geo-rep: Fix Rsync hang issue
When rsync is executed using Python subprocess, by default stdout of subprocess will be None. With the log rsync performance patch stdout is assigned to PIPE. Rsync writes to that PIPE whenever it syncs files. If log_rsync_performance is disabled then nobody will consume stdout and that gets full. Rsync hangs if PIPE is full. log_rsync_performance option is introduced with patch 10070 With this patch stdout=PIPE only if log_rsync_performance is enabled. Also removed -v option from Rsync. Thanks Venky and Kotresh for RCA. BUG: 1219444 Change-Id: I4b06ca2ebdcb93ac8319f60bc637182fb3d38091 Original-Author: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/10556 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10634 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/resource.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 2a04d632091..71fcc8c798f 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -904,14 +904,22 @@ class SlaveRemote(object):
raise GsyncdError("no files to sync")
logging.debug("files: " + ", ".join(files))
argv = gconf.rsync_command.split() + \
- ['-avR0', '--inplace', '--files-from=-', '--super',
+ ['-aR0', '--inplace', '--files-from=-', '--super',
'--stats', '--numeric-ids', '--no-implied-dirs'] + \
gconf.rsync_options.split() + \
(boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \
(boolify(gconf.sync_acls) and ['--acls'] or []) + \
['.'] + list(args)
- po = Popen(argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+
+ if gconf.log_rsync_performance:
+ # use stdout=PIPE only when log_rsync_performance enabled
+ # Else rsync will write to stdout and nobody is their
+ # to consume. If PIPE is full rsync hangs.
+ po = Popen(argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ else:
+ po = Popen(argv, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+
for f in files:
po.stdin.write(f)
po.stdin.write('\0')