Skip to content

Commit 9e61f4f

Browse files
authored
Merge pull request #2976 from hazendaz/master
[ci] Handle wait condition and write log if it fails
2 parents 419ab4e + 6f4f791 commit 9e61f4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ private PooledConnection popConnection(String username, String password) throws
494494
log.debug("Waiting as long as " + poolTimeToWait + " milliseconds for connection.");
495495
}
496496
long wt = System.currentTimeMillis();
497-
condition.await(poolTimeToWait, TimeUnit.MILLISECONDS);
497+
if (!condition.await(poolTimeToWait, TimeUnit.MILLISECONDS)) {
498+
log.debug("Wait failed...");
499+
}
498500
state.accumulatedWaitTime += System.currentTimeMillis() - wt;
499501
} catch (InterruptedException e) {
500502
// set interrupt flag

0 commit comments

Comments
 (0)