JavaWebStack / JavaWebStack/orm
Queue.take in SQLPool can produce deadlock
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 7
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Queue.takeを使用するSQLPoolのパスから始め、getを2回呼び出して、プールサイズが1の場合に問題を再現します。現在のブロッキング動作を、想定される時間制限付きの待機およびExceptionと比較し、利用可能な接続がない場合でもアプリケーションが stuck のままにならないことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100