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

Queue.take in SQLPool can produce deadlock #58

Open
JanHolger opened this issue Nov 14, 2024 · 0 comments
Open

Queue.take in SQLPool can produce deadlock #58

JanHolger opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JanHolger
Copy link
Member

Describe the Bug
In SQLPool we use take on the queue to wait for a connection to become available. If no connections become available (for example if a single thread is using up all connections) it produces a deadlock causing a lockup of the entire application since all database queries will run into a deadlock

To Reproduce
Steps to reproduce the behavior:

  1. Set the pool size to 1
  2. Call get once
  3. Call get a second time -> gets stuck

Expected behavior
The pool should use poll instead and throw an Exception after a reasonable amount of waiting time preventing a lockup of the entire application

Environment Information:

  • Java Language Level 8
  • Version 1.0.3

Additional Context
The root cause of this might be a different issue since the pool shouldn't have ran out of connections in the first place. We can check this issue once proper exceptions are thrown.

@JanHolger JanHolger added the bug Something isn't working label Nov 14, 2024
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