Commit 629a8f39 authored by Vincent Pelletier's avatar Vincent Pelletier

Prevent exceptions raised in notifyUser from making finalizeMessageExecution raise.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19089 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6e195902
...@@ -373,6 +373,7 @@ class SQLDict(RAMDict, SQLBase): ...@@ -373,6 +373,7 @@ class SQLDict(RAMDict, SQLBase):
LOG('SQLDict', PANIC, 'Failed to unreserve %r' % (make_available_uid_list, ), error=sys.exc_info()) LOG('SQLDict', PANIC, 'Failed to unreserve %r' % (make_available_uid_list, ), error=sys.exc_info())
else: else:
LOG('SQLDict', TRACE, 'Freed messages %r' % (make_available_uid_list, )) LOG('SQLDict', TRACE, 'Freed messages %r' % (make_available_uid_list, ))
try:
for m in notify_user_list: for m in notify_user_list:
m.notifyUser(activity_tool) m.notifyUser(activity_tool)
for m in message_with_active_process_list: for m in message_with_active_process_list:
...@@ -380,6 +381,9 @@ class SQLDict(RAMDict, SQLBase): ...@@ -380,6 +381,9 @@ class SQLDict(RAMDict, SQLBase):
if not active_process.hasActivity(): if not active_process.hasActivity():
# No more activity # No more activity
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ??? m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ???
except:
# Notification failures must not cause this method to raise.
LOG('SQLDict', WARNING, 'Exception during notification phase of finalizeMessageExecution', error=sys.exc_info())
# Queue semantic # Queue semantic
def dequeueMessage(self, activity_tool, processing_node): def dequeueMessage(self, activity_tool, processing_node):
......
...@@ -244,6 +244,7 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -244,6 +244,7 @@ class SQLQueue(RAMQueue, SQLBase):
processing_node=INVOKE_ERROR_STATE) processing_node=INVOKE_ERROR_STATE)
except: except:
LOG('SQLQueue', PANIC, 'Failed to set message to error state for %r' % (final_error_uid_list, ), error=sys.exc_info()) LOG('SQLQueue', PANIC, 'Failed to set message to error state for %r' % (final_error_uid_list, ), error=sys.exc_info())
try:
for m in notify_user_list: for m in notify_user_list:
m.notifyUser(activity_tool) m.notifyUser(activity_tool)
for m in message_with_active_process_list: for m in message_with_active_process_list:
...@@ -251,7 +252,9 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -251,7 +252,9 @@ class SQLQueue(RAMQueue, SQLBase):
if not active_process.hasActivity(): if not active_process.hasActivity():
# No more activity # No more activity
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ??? m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ???
except:
# Notification failures must not cause this method to raise.
LOG('SQLQueue', WARNING, 'Exception during notification phase of finalizeMessageExecution', error=sys.exc_info())
def dequeueMessage(self, activity_tool, processing_node): def dequeueMessage(self, activity_tool, processing_node):
def makeMessageListAvailable(uid_list): def makeMessageListAvailable(uid_list):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment