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

Deadlock Detected in bulk update payments. #433

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hemant10yadav
Copy link
Contributor

@hemant10yadav hemant10yadav commented Nov 14, 2024

CCCT-549

Sentry link

  • The deadlock error indicates that two separate transactions were trying to access the same data in conflicting orders, even though the code is using a single transaction.atomic() block.
  • This suggests there are concurrency issues beyond just the single transaction, likely due to the fact that this is a Celery task.
  • The transaction.atomic() block only ensures atomicity within a single Celery task, but does not prevent deadlocks between multiple concurrent tasks.

To resolve this, I have moved the task that updates the payment date work into another transaction.atomic() block. This can help reduce contention and the likelihood of deadlocks.

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

Successfully merging this pull request may close these issues.

2 participants