From 7a2362d818baf7cae0ae54ffede436821491c876 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Fri, 7 Sep 2012 01:05:20 +0200 Subject: 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 Reviewed-on: http://review.gluster.org/3917 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/features/marker/utils/syncdaemon/resource.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index 47e4748d..7eced825 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 -- cgit