summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-09-07 01:05:20 +0200
committerVijay Bellur <vbellur@redhat.com>2012-10-10 01:09:20 -0400
commit81376bf77541bcd2f1e85fb0375938c2dd0a16ea (patch)
treed6d833f29e9483d03e2c4042527581dd26ce0e57
parentdd70d18f57f8f7fb3af2b59872f81aefc564c0b2 (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: 859173 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: https://code.engineering.redhat.com/gerrit/62 Tested-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-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 e326b81aae1..d5df03c0f74 100644
--- a/xlators/features/marker/utils/syncdaemon/resource.py
+++ b/xlators/features/marker/utils/syncdaemon/resource.py
@@ -524,10 +524,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