Skip to content

Queue.take in SQLPool can produce deadlock #58

@JanHolger

Description

@JanHolger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions