From b617b89372f9f6cb5031dfb8513029a7fa490f73 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Fri, 15 Jul 2011 02:45:18 +0200 Subject: gsyncd: refine command invocation Use subprocess module instead of os.spawn* / ad-hoc fork/exec. With this, we do now: - close uneeded files in children - watch childrens' stderr: - have a thread which collects childrens' stderr into a ring buffer (so that stderr pipe doesn't get stuffed) - on command failure show stderr - distinguish between rsync exit values, tolerate only partial errors - if connection is broken to slave, show ssh/slave gsycd's stderr Change-Id: Ia92f57b5bdfa47f8c44375c50cf279006a0bf69b BUG: 2946 Reviewed-on: http://review.gluster.com/85 Tested-by: Gluster Build System Tested-by: Kaushik BV Reviewed-by: Kaushik BV --- xlators/features/marker/utils/syncdaemon/master.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xlators/features/marker/utils/syncdaemon/master.py') diff --git a/xlators/features/marker/utils/syncdaemon/master.py b/xlators/features/marker/utils/syncdaemon/master.py index 495634b06..e7cb977e8 100644 --- a/xlators/features/marker/utils/syncdaemon/master.py +++ b/xlators/features/marker/utils/syncdaemon/master.py @@ -381,7 +381,15 @@ class Syncer(object): break time.sleep(0.5) pb.close() - pb.wakeup(self.slave.rsync(pb)) + po = self.slave.rsync(pb) + if po.returncode == 0: + ret = True + elif po.returncode in (23, 24): + # partial transfer (cf. rsync(1)), that's normal + ret = False + else: + po.errfail() + pb.wakeup(ret) def add(self, e): while True: -- cgit