{"push_id":2953869780,"size":1,"distinct_size":1,"ref":"refs/heads/saas-11.4-fixes-tde","head":"56596e5240ef920df14d99087451ce6f06ac6d36","before":"2e23ac88c2bbaf1e8a3944631d7f7c7e6c3d1641","commits":[{"sha":"56596e5240ef920df14d99087451ce6f06ac6d36","author":{"name":"Thibault Delavallée","email":"2d325771bb6e8870d87f0f3f7b45589a8338e550@odoo.com"},"message":"[FIX] mail: avoid concurrent update of notifications\n\nWhen sending notifications by batch one notification email can be send\nup to 50 people. For one mail_mail entry to handle 50 emails can be sent\nas those are sent independently for each recipient.\n\nIn some cases a bounce may occur while the whole batch of recipients is\nnot completely mailed. In that case the mailgateway will update the\nnotification status to bounced. When the cron finishes to send the whole\nbatch of emails it tries to update the notifications of all recipients.\nHowever as a notification has already been updated due to the bounce we\nface a concurrent update, meaning the transaction is rollbacked.\n\nEmails have been sent but notifications are not considered as sent as they\nhave not been updated accordingly. Next time the cron runs it will send the\nsame batch again, with probably the same bounce and rollback. We could\ntherefore face an email loop.\n\nThis commit fixes that by setting notifications to a transient exception\nstate. Notifications are locked, meaning bounced will have to wait for the\ntransaction to finish before updating them. That way the cron can run\nsafely on the whole batch and we avoid having emails loop. It has an impact\non query count as a search and write is performed in the send process.\n\nThis commit is linked to task ID 1893054. Done in collaboration with\n@Xavier-Do .","distinct":true,"url":"https://api.github.com/repos/odoo-dev/odoo/commits/56596e5240ef920df14d99087451ce6f06ac6d36"}]}
{"actor":{"display_login":"tde-banana-odoo"}}