From d6407c59a4fd262749edd11ecb457b1e5be7a77a Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Wed, 9 Feb 2011 02:12:59 +0000 Subject: syncdaemon: Syncdaemon should not crash on ENOENT while performing setxattr() Signed-off-by: Kaushik BV Signed-off-by: Anand V. Avati BUG: 2342 ([glusterfs-3.1.2geosyncqa4]: crash in gsyncd script) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2342 --- xlators/features/marker/utils/syncdaemon/resource.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index 3aaca02c025..659e344f8e1 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -156,7 +156,12 @@ class Server(object): @classmethod def set_xtime(cls, path, uuid, mark): - Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark)) + try: + Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark)) + except OSError: + ex = sys.exc_info()[1] + if ex.errno == ENOENT: + logging.error ("File for which the setxattr to be done is not present") @staticmethod def setattr(path, adct): -- cgit