Repository navigation
Conversation
amh-mw
left a comment
There was a problem hiding this comment.
Code review only, LGTM. This reminds me of workarounds I was using locally prior to the implementation of allow_commit.
| traceback_txt = buff.getvalue() | ||
| with StringIO() as buff: | ||
| traceback.print_exc(file=buff) | ||
| traceback_txt = buff.getvalue() |
There was a problem hiding this comment.
I'm fine with the earlier reclamation of memory here; just calling it out since it is not germaine to the primary intent of this pull request.
39ed622 to
b64a51f
Compare
|
This PR has the |
|
Sounds like a good simplification. One question: there are some operations done in |
It seems that it is a valid concern. Other lines are not likely to trigger a concurrency error:
|
The failure is handled from a temporary cursor while the failed job's transaction still holds its locks: an on fail hook writing on the same records waited forever. Perform the job in a savepoint so that its locks are released when it fails.
fa1b124 to
38baa61
Compare
| # that the stored computed fields are part of the 'exec_time'. | ||
| with env.cr.savepoint(): | ||
| job.perform() | ||
| job.perform() |
There was a problem hiding this comment.
Can you move this now removed comment to the perfom definition?
I think it's important that we keep track WHY we chose to use a savepoint
Or keep it here but rephrase it so that it mentions that perform will run in a savepoint
There was a problem hiding this comment.
I've updated the comment.
38baa61 to
dc13981
Compare
This is a simplification.
This is needed for the change proposed in:
Changes:
job.perform()so that cursor can be re-used in case of OperationalError"queue.job"record-use the same cursor, which is in good shape thanks to the savepoint
allow_commit=Trueuse case)