JavaWebStack / JavaWebStack/orm
Queue.take in SQLPool can produce deadlock
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 7
- Forks
- 1
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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:
- Set the pool size to 1
- Call get once
- 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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem SQLPool-Pfad, der Queue.take verwendet, und reproduziere dann das Problem bei einer Poolgröße von 1, indem du get zweimal aufrufst. Vergleiche das aktuelle blockierende Verhalten mit dem erwarteten zeitbegrenzten Warten und der Exception und überprüfe, dass die Anwendung nicht länger hängen bleibt, wenn keine Verbindung verfügbar wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100