Skip to content

Commit 30be4a2

Browse files
committed
fix polling null from the available pooled connections
Signed-off-by: Billy Yuan <billy112487983@gmail.com>
1 parent a4e49c5 commit 30be4a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/ConnectionPool.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ private void check() {
242242
while (waiters.size() > 0) {
243243
if (available.size() > 0) {
244244
PooledConnection proxy = available.poll();
245+
if (proxy == null) {
246+
// available is empty?
247+
return;
248+
}
245249
Handler<AsyncResult<Connection>> waiter = waiters.poll();
246250
waiter.handle(Future.succeededFuture(proxy));
247251
} else {

0 commit comments

Comments
 (0)