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 creating code_systems in Derby #1417

Closed
punktilious opened this issue Aug 15, 2020 · 1 comment
Closed

Deadlock creating code_systems in Derby #1417

punktilious opened this issue Aug 15, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@punktilious
Copy link
Collaborator

Describe the bug

Creating new code-systems in parallel can cause deadlocks in Derby.

Caused by: ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, CODE_SYSTEMS, (1,7)
  Waiting XID : {24547, S} , APP, SELECT code_system_id FROM code_systems WHERE code_system_name = ?
  Granted XID : {24549, X}
Lock : ROW, CODE_SYSTEMS, (1,8)
  Waiting XID : {24549, S} , APP, SELECT code_system_id FROM code_systems WHERE code_system_name = ?
  Granted XID : {24547, X}

To Reproduce
Steps to reproduce the behavior:
Create new resources in parallel where those resources require the creation of new code-systems.

Expected behavior
All resources loaded successfully without any failures due to deadlocks.

Additional context
This appears to be due to its less sophisticated concurrency control and the row-locking behavior of Derby. Db2 and PostgresSQL use more advanced locking mechanisms to avoid this sort of issue.

Derby is not recommended for production use. Because this issue does not occur on Db2 and PostgreSQL, fixing it is lower priority.

@punktilious punktilious added the bug Something isn't working label Aug 15, 2020
@punktilious
Copy link
Collaborator Author

Duplicate of #2837 which is being fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant