tentative de résolution du bug 234 (je pense que ça le corrige mais je n'i pas vérifié)

This commit is contained in:
Guillaume Raffy 2012-07-02 09:01:06 +00:00
parent d67c4d6a21
commit a1ace896b9
1 changed files with 9 additions and 1 deletions

View File

@ -208,7 +208,15 @@ def onException(exception):
f.close() f.close()
logError(strMessage) logError(strMessage)
print(strMessage) print(strMessage)
Lib.Util.sendTextMail( 'ClusterController <guillaume.raffy@univ-rennes1.fr>', '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>', '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 executeCommand('kill -9 %d' % os.getpid()) # stop other threads immediately
exit() exit()