summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-09-07 01:05:20 +0200
committerAnand Avati <avati@redhat.com>2012-09-07 16:50:08 -0700
commit7a2362d818baf7cae0ae54ffede436821491c876 (patch)
treee7f95f777733f4af205a6b3b6490272360eead27 /xlators
parentc78919ce37ca55aa789733ca7f2b4beef72d7a54 (diff)
geo-rep/gsyncd: work around rsync argument overflow
instead of passing the files to be synced as args to rsync, have rsync read them on stdin with '-0 --files-from=-' Change-Id: Ic3f71a0269941ce50051af8adfad183a52a79b01 BUG: 855306 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.org/3917 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/utils/syncdaemon/resource.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py
index 47e4748df30..7eced825c22 100644
--- a/xlators/features/marker/utils/syncdaemon/resource.py
+++ b/xlators/features/marker/utils/syncdaemon/resource.py
@@ -536,10 +536,15 @@ class SlaveRemote(object):
if not files:
raise GsyncdError("no files to sync")
logging.debug("files: " + ", ".join(files))
- argv = gconf.rsync_command.split() + ['-aR', '--super', '--numeric-ids', '--no-implied-dirs'] + \
+ argv = gconf.rsync_command.split() + \
+ ['-aR0', '--files-from=-', '--super', '--numeric-ids', '--no-implied-dirs'] + \
gconf.rsync_options.split() + (boolify(gconf.use_rsync_xattrs) and ['--xattrs'] or []) + \
- files + list(args)
- po = Popen(argv, stderr=subprocess.PIPE)
+ ['.'] + list(args)
+ po = Popen(argv, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ for f in files:
+ po.stdin.write(f)
+ po.stdin.write('\0')
+ po.stdin.close()
po.wait()
po.terminate_geterr(fail_on_err = False)
return po