From a1ace896b93d3771545685d53dfe482e1162bcac Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Mon, 2 Jul 2012 09:01:06 +0000 Subject: [PATCH] =?UTF-8?q?tentative=20de=20r=C3=A9solution=20du=20bug=202?= =?UTF-8?q?34=20(je=20pense=20que=20=C3=A7a=20le=20corrige=20mais=20je=20n?= =?UTF-8?q?'i=20pas=20v=C3=A9rifi=C3=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ClusterController/Util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ClusterController/Util.py b/ClusterController/Util.py index 3db4bfb..7ae091f 100644 --- a/ClusterController/Util.py +++ b/ClusterController/Util.py @@ -208,7 +208,15 @@ def onException(exception): f.close() logError(strMessage) print(strMessage) - Lib.Util.sendTextMail( 'ClusterController ', 'guillaume.raffy@univ-rennes1.fr', 'ClusterController has stopped because of an exception', strMessage) + + try: + # I had the case (see bugzilla 234) where an assert failed in a child thread, but the main process kept going. I suspect that it was caused + #by a failure of sendTextMail... that's why I've embedded the sendmail inside a try except block, so that is this operation fails, then the + # kill of the main process is still executed. + Lib.Util.sendTextMail( 'ClusterController ', 'guillaume.raffy@univ-rennes1.fr', 'ClusterController has stopped because of an exception', strMessage) + except BaseException: + logError("Could not send the email to notify the administrator that cluster controller failed") + pass executeCommand('kill -9 %d' % os.getpid()) # stop other threads immediately exit()