Commit d743cfbe authored by Jérome Perrin's avatar Jérome Perrin

if a error happen in ActivityTool.invoke or around, the message will immediatly

be put in INVOKE_ERROR_STATE, but we will LOG a traceback (maybe we should
also call notifyUser).
remove the obsolete comment "what happens if read conflict error restarts
transaction", because this is handled explicitly here.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13404 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 280003a6
...@@ -326,6 +326,8 @@ class SQLDict(RAMDict): ...@@ -326,6 +326,8 @@ class SQLDict(RAMDict):
if len(uid_list): if len(uid_list):
activity_tool.SQLDict_assignMessage(uid = uid_list, activity_tool.SQLDict_assignMessage(uid = uid_list,
processing_node = INVOKE_ERROR_STATE) processing_node = INVOKE_ERROR_STATE)
LOG('SQLDict', WARNING, 'Error in ActivityTool.invoke', e=sys.exc_info())
get_transaction().commit() get_transaction().commit()
return 0 return 0
......
...@@ -122,7 +122,7 @@ class SQLQueue(RAMQueue): ...@@ -122,7 +122,7 @@ class SQLQueue(RAMQueue):
return 0 return 0
# Try to invoke # Try to invoke
activity_tool.invoke(m) # Try to invoke the message - what happens if read conflict error restarts transaction ? activity_tool.invoke(m) # Try to invoke the message
if m.is_executed: # Make sure message could be invoked if m.is_executed: # Make sure message could be invoked
get_transaction().commit() # If successful, commit get_transaction().commit() # If successful, commit
except: except:
...@@ -142,6 +142,8 @@ class SQLQueue(RAMQueue): ...@@ -142,6 +142,8 @@ class SQLQueue(RAMQueue):
# For the other exceptions, put it into an error state. # For the other exceptions, put it into an error state.
activity_tool.SQLQueue_assignMessage(uid = line.uid, activity_tool.SQLQueue_assignMessage(uid = line.uid,
processing_node = INVOKE_ERROR_STATE) processing_node = INVOKE_ERROR_STATE)
LOG('SQLQueue', WARNING, 'Error in ActivityTool.invoke', e=sys.exc_info())
get_transaction().commit() get_transaction().commit()
return 0 return 0
......
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