Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] tracking_manager: Deadlock when confirm sale.order (change state to 'sale') #2990

Open
imbarbudiman opened this issue Jul 10, 2024 · 0 comments
Labels

Comments

@imbarbudiman
Copy link

imbarbudiman commented Jul 10, 2024

Module

tracking_manager

Describe the bug

Sometimes a deadlock occurs when confirm a Sale Order/sale.order (change state to 'sale').

In Base class when call super().unlink()

RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "/home/odoo/src/odoo/odoo/http.py", line 1632, in _serve_db

    return service_model.retrying(self._serve_ir_http, self.env)

  File "/home/odoo/src/odoo/odoo/service/model.py", line 172, in retrying

    env.cr.commit()  # effectively commits and execute post-commits

  File "/home/odoo/src/odoo/odoo/sql_db.py", line 467, in commit

    self.postcommit.run()

  File "/home/odoo/src/odoo/odoo/tools/misc.py", line 1210, in run

    func()

  File "/home/odoo/src/odoo/addons/mail/models/mail_thread.py", line 2657, in send_notifications

    env['mail.mail'].browse(email_ids).send()

  File "/home/odoo/src/odoo/addons/mail/models/mail_mail.py", line 440, in send

    self.browse(batch_ids)._send(

  File "/home/odoo/src/odoo/addons/mail/models/mail_mail.py", line 585, in _send

    mail._postprocess_sent_message(success_pids=success_pids, failure_type=failure_type)

  File "/home/odoo/src/odoo/addons/mail/models/mail_mail.py", line 292, in _postprocess_sent_message

    self.sudo().filtered(lambda mail: mail.auto_delete).unlink()

  File "/home/odoo/src/odoo/addons/mail/models/mail_mail.py", line 176, in unlink

    res = super(MailMail, self).unlink()

  File "/home/odoo/src/user/tracking_manager/models/models.py", line 156, in unlink

    return super().unlink()

  File "/home/odoo/src/odoo/odoo/models.py", line 3597, in unlink

    cr.execute(query, (sub_ids,))

  File "/home/odoo/src/odoo/odoo/sql_db.py", line 321, in execute

    res = self._obj.execute(query, params)

psycopg2.errors.DeadlockDetected: deadlock detected

DETAIL:  Process 625497 waits for ShareLock on transaction 428976373; blocked by process 625681.

Process 625681 waits for ShareLock on transaction 428975996; blocked by process 625497.

HINT:  See server log for query details.

CONTEXT:  while deleting tuple (12878,1) in relation "mail_mail"

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Confirm/approve sale order

Expected behavior
No deadlock

Additional context
Hosting on odoo.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant