From b793589e856b866f3cab54227237f3548267e9bc Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 26 Nov 2012 17:44:36 +0100 Subject: geo-replication: catch select.error on select() From upstream commit 15bf92d53c72774e2fd7aba146644a2e460e543f: > tailer() in resource.py does not correctly catch exceptions from > select(). select() can raise an instance of the select.error class and > the current expression only catches ValueError (and the instance will > have reference called selecterror). > > The geo-rep log contains a call trace like this: > > E [syncdutils:190:log_raise_exception] : FAIL: > > Traceback (most recent call last): > > File "/usr/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 216, in twrap > > tf(*aa) > > File "/usr/libexec/glusterfs/python/syncdaemon/resource.py", line 123, in tailer > > poe, _ ,_ = select([po.stderr for po in errstore], [], [], 1) > > File "/usr/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 276, in select > > return eintr_wrap(oselect.select, oselect.error, *a) > > File "/usr/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 269, in eintr_wrap > > return func(*a) > > error: (9, 'Bad file descriptor') > > BUG: 880308 > Change-Id: I2babe42918950d0e9ddb3d08fa21aa3548ccf7c5 > Signed-off-by: Niels de Vos > Reviewed-on: http://review.gluster.org/4233 > Reviewed-by: Peter Portante > Reviewed-by: Csaba Henk > Tested-by: Gluster Build System BUG: 880308 Change-Id: Iece1f50c0064853669d1dd4a777f77f10e2fd0dc Upstream-bug: 886808 (changed after upstream merge) Signed-off-by: Niels de Vos Reviewed-on: https://code.engineering.redhat.com/gerrit/1927 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/features/marker/utils/syncdaemon/resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index 7eced825c22..adcf5585964 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -12,7 +12,7 @@ import tempfile import threading import subprocess from errno import EEXIST, ENOENT, ENODATA, ENOTDIR, ELOOP, EISDIR -from select import error as selecterror +from select import error as SelectError from gconf import gconf import repce @@ -121,7 +121,7 @@ class Popen(subprocess.Popen): errstore = cls.errstore.copy() try: poe, _ ,_ = select([po.stderr for po in errstore], [], [], 1) - except ValueError, selecterror: + except (ValueError, SelectError): continue for po in errstore: if po.stderr not in poe: -- cgit