summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-10-11 13:40:05 +0200
committerThibault Delavallée <tde@odoo.com>2018-10-12 12:50:39 +0200
commit56596e5240ef920df14d99087451ce6f06ac6d36 (patch)
tree1445ea32b22ca551d6dae039bad163daca9d3894 /doc/reference/javascript_reference.rst
parenta78108318606a0709d40c4849e45b0788d2954a1 (diff)
[FIX] mail: avoid concurrent update of notifications
When sending notifications by batch one notification email can be send up to 50 people. For one mail_mail entry to handle 50 emails can be sent as those are sent independently for each recipient. In some cases a bounce may occur while the whole batch of recipients is not completely mailed. In that case the mailgateway will update the notification status to bounced. When the cron finishes to send the whole batch of emails it tries to update the notifications of all recipients. However as a notification has already been updated due to the bounce we face a concurrent update, meaning the transaction is rollbacked. Emails have been sent but notifications are not considered as sent as they have not been updated accordingly. Next time the cron runs it will send the same batch again, with probably the same bounce and rollback. We could therefore face an email loop. This commit fixes that by setting notifications to a transient exception state. Notifications are locked, meaning bounced will have to wait for the transaction to finish before updating them. That way the cron can run safely on the whole batch and we avoid having emails loop. It has an impact on query count as a search and write is performed in the send process. This commit is linked to task ID 1893054. Done in collaboration with @Xavier-Do .
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions