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/syncdutils.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/syncdutils.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/syncdutils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/syncdutils.py b/xlators/features/marker/utils/syncdaemon/syncdutils.py index a905745f1b4..35afe64e931 100644 --- a/xlators/features/marker/utils/syncdaemon/syncdutils.py +++ b/xlators/features/marker/utils/syncdaemon/syncdutils.py @@ -146,6 +146,9 @@ def log_raise_exception(excont): ((isinstance(exc, OSError) or isinstance(exc, IOError)) and \ exc.errno == EPIPE): logging.error('connection to peer is broken') + if hasattr(gconf, 'transport'): + gconf.transport.wait() + gconf.transport.terminate_geterr() elif isinstance(exc, OSError) and exc.errno == ENOTCONN: logging.error('glusterfs session went down') else: |