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,13 +373,17 @@ class SQLDict(RAMDict, SQLBase): ...@@ -373,13 +373,17 @@ 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, ))
for m in notify_user_list: try:
m.notifyUser(activity_tool) for m in notify_user_list:
for m in message_with_active_process_list: m.notifyUser(activity_tool)
active_process = activity_tool.unrestrictedTraverse(m.active_process) for m in message_with_active_process_list:
if not active_process.hasActivity(): active_process = activity_tool.unrestrictedTraverse(m.active_process)
# No more activity if not active_process.hasActivity():
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ??? # No more activity
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,14 +244,17 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -244,14 +244,17 @@ 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())
for m in notify_user_list: try:
m.notifyUser(activity_tool) for m in notify_user_list:
for m in message_with_active_process_list: m.notifyUser(activity_tool)
active_process = activity_tool.unrestrictedTraverse(m.active_process) for m in message_with_active_process_list:
if not active_process.hasActivity(): active_process = activity_tool.unrestrictedTraverse(m.active_process)
# No more activity if not active_process.hasActivity():
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ??? # No more activity
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