deadlock with multiple threads on getConnection()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BoneCP |
Fix Committed
|
Undecided
|
Unassigned | ||
Ubuntu |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm using boneCP (0.7.1-release) in a setting where multiple threads are using one boneCP object to share some database connections. The threads are using the try-with-resources Java 7 language construct:
try( Connection conn = pbds.getConnect
} catch (SQLException e) {
e.printStack
}
Sometimes my application (mainly in load-testing) completely hangs up and doesn't do anything. In the debugger, I find that all the threads are blocking on the getConnection() call. The queries are quick to run and shouldn't be taking long, so I'm pretty sure the db calls are not the problem.
I discover that increasing maxConnectionsP
pbds = new BoneCPDataSource();
pbds.
pbds.
pbds.
pbds.
pbds.
pbds.
On certain machines, the problem is easily reproducible when maxConnectionsP
I'm not sure how best to debug this problem. Please point me in the direction of what information I can provide additionally that will be helpful.
Thanks,
Andrew
This might help. I can reproduce the deadlock and then suspend threads that are blocking on it; here is the call stack of a given thread.