Skip to content

Commit e0d868d

Browse files
committed
In rare cases node can be no member of busylist
1 parent 4b64545 commit e0d868d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionBuffer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,12 @@ void addFree(PooledConnection pc) {
177177
* Returns true, if this connection was part of the busy list or false, if not (or removed twice)
178178
*/
179179
boolean removeBusy(PooledConnection c) {
180-
if (c.busyNode() == null) {
180+
Node node = c.busyNode();
181+
if (node == null || node.next == null) {
182+
// node is not yet or no longer in busy list
181183
return false;
182184
}
183-
c.busyNode().remove();
185+
node.remove();
184186
busySize--;
185187
c.setBusyNode(null);
186188
return true;

0 commit comments

Comments
 (0)