[10.0] retry_postpone using new cursor - #41
Conversation
| job.store() | ||
| env.cr.commit() | ||
|
|
||
| job.env.cr.rollback() |
There was a problem hiding this comment.
shouldn't you rollback only in case of errors? /cc @guewen
There was a problem hiding this comment.
I think it's there to prevent a conflict between the job.env's transaction and the new one. The job record might have been updated by the first one and will be updated by the second one? It's not called in the FailedJobError case though so why is it necessary here?
guewen
left a comment
There was a problem hiding this comment.
Do you use this in production? Since when and do you see any side-effect?
| job.store() | ||
| env.cr.commit() | ||
|
|
||
| job.env.cr.rollback() |
There was a problem hiding this comment.
I think it's there to prevent a conflict between the job.env's transaction and the new one. The job record might have been updated by the first one and will be updated by the second one? It's not called in the FailedJobError case though so why is it necessary here?
| # but not too short so we trap and log hard configuration errors | ||
| response = requests.get(url, timeout=1) | ||
| # CGT: timeout must be hight enought to wait for server startup | ||
| response = requests.get(url, timeout=15) |
There was a problem hiding this comment.
Why is it required for you? What's your setup?
|
@yvaucher all unnecessary commits to this pull request have been reverted, sorry for the delay |
guewen
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution!
|
Note: to be squashed on merge |
If the job's transaction fail with an OperationalError such as a contraint failure, the transaction is broken and we will not be able to postpone the job. Open a new transaction to change the job's state. Port of: - OCA#41 from @2zx - OCA#130 from @liweijie0812
I've experienced this error
trying to requeue a job in case of a failure due to SQL errors (typically concurrency errors)
I think the problem can be solved with the use of a new cr as it is done in the case of a failed job