Commit a836746a authored by Vincent Pelletier's avatar Vincent Pelletier

Catch and log exceptions at process_timer level so that a raising distribute,...

Catch and log exceptions at process_timer level so that a raising distribute, wakeup or tic call can reach transaction end ASAP.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19081 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 10e81d33
......@@ -593,7 +593,9 @@ class ActivityTool (Folder, UniqueObject):
# because processing_node starts form 1
if currentNode in processing_node_list:
self.tic(processing_node_list.index(currentNode)+1)
except:
# Catch ALL exception to avoid killing timerserver.
LOG('ActivityTool', ERROR, 'process_timer received an exception', error=sys.exc_info())
finally:
timerservice_lock.release()
setSecurityManager(old_sm)
......@@ -609,12 +611,7 @@ class ActivityTool (Folder, UniqueObject):
# Call distribute on each queue
for activity in activity_list:
try:
activity.distribute(aq_inner(self), node_count)
except ConflictError:
raise
except:
LOG('CMFActivity:', 100, 'Core call to distribute failed for activity %s' % activity, error=sys.exc_info())
security.declarePublic('tic')
def tic(self, processing_node=1, force=0):
......@@ -652,25 +649,15 @@ class ActivityTool (Folder, UniqueObject):
try:
# Wakeup each queue
for activity in activity_list:
try:
activity.wakeup(inner_self, processing_node)
except ConflictError:
raise
except:
LOG('CMFActivity:', 100, 'Core call to wakeup failed for activity %s' % activity)
# Process messages on each queue in round robin
has_awake_activity = 1
while has_awake_activity:
has_awake_activity = 0
for activity in activity_list:
try:
activity.tic(inner_self, processing_node) # Transaction processing is the responsability of the activity
has_awake_activity = has_awake_activity or activity.isAwake(inner_self, processing_node)
except ConflictError:
raise
except:
LOG('CMFActivity:', 100, 'Core call to tic or isAwake failed for activity %s' % activity, error=sys.exc_info())
finally:
# decrease the number of active_threads
tic_lock.acquire()
......
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