diff options
author | Csaba Henk <csaba@gluster.com> | 2011-07-15 02:45:18 +0200 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-08-25 05:36:45 -0700 |
commit | b617b89372f9f6cb5031dfb8513029a7fa490f73 (patch) | |
tree | 0517a825e979f0615ddea7e8507ea6261db5f1e2 /xlators/features/marker/utils/syncdaemon/master.py | |
parent | f9b09cd2be47c044c1396e70724a427ef46f8b81 (diff) |
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 <jenkins@build.gluster.com>
Tested-by: Kaushik BV <kaushikbv@gluster.com>
Reviewed-by: Kaushik BV <kaushikbv@gluster.com>
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/master.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/master.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/master.py b/xlators/features/marker/utils/syncdaemon/master.py index 495634b06cf..e7cb977e8ad 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: |