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 exception thrown from beforeinsertuserannotation() #1202

Open
yasushinj opened this issue May 5, 2021 · 0 comments
Open

Deadlock exception thrown from beforeinsertuserannotation() #1202

yasushinj opened this issue May 5, 2021 · 0 comments
Labels
Milestone

Comments

@yasushinj
Copy link

We have a cluster set up for the process to spawn multiple annotation update threads for images found in the same project.
40-50 threads are running simultaneously to update annotation for images in the same project,

It looks like getting the database lock for project level counter is leading to deadlock as shown below.

So, is there any way to switch this to more thread safe mechanism?
Temporarily, we may need to comment out this code segment and switch to cron job to update counter for now.

Regards,

Detail: Process 326922 waits for AccessExclusiveLock on tuple (35,53) of relation 39586 of database 38367; blocked by process 326830.
Process 326830 waits for ShareLock on transaction 13883189; blocked by process 326743.
Process 326743 waits for ShareLock on transaction 13883206; blocked by process 326777.
Process 326777 waits for AccessExclusiveLock on tuple (35,53) of relation 39586 of database 38367; blocked by process 326922.
Hint: See server log for query details.
Where: SQL statement "SELECT * FROM project where id = NEW.project_id FOR UPDATE"
PL/pgSQL function beforeinsertuserannotation() line 8 at SQL statement
05-05-2021 01:00:01,984 ERROR SqlExceptionHelper - ERROR: deadlock detected
Detail: Process 326951 waits for AccessExclusiveLock on tuple (35,53) of relation 39586 of database 38367; blocked by process 326877.
Process 326877 waits for ShareLock on transaction 13883189; blocked by process 326743.
Process 326743 waits for ShareLock on transaction 13883206; blocked by process 326777.

@geektortoise geektortoise added this to the V3.1.0 milestone May 5, 2021
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

2 participants