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()