Skip to content

Commit b1665b9

Browse files
committed
If keepalive fails on a Channel, remove it from the pool
1 parent fe824aa commit b1665b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

driver/src/main/java/oracle/nosql/driver/httpclient/ConnectionPool.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,14 @@ int doKeepAlive(int keepAlivePeriod) {
462462
}
463463
logFine(logger,
464464
"Sending keepalive on channel " + ch + ", stats: " + cs);
465-
keepAlive.keepAlive(ch);
465+
boolean didKeepalive = keepAlive.keepAlive(ch);
466+
if (!didKeepalive) {
467+
logFine(logger,
468+
"Keepalive failed on channel " + ch +
469+
", removing from pool");
470+
removeChannel(ch);
471+
continue;
472+
}
466473
cs.acquired(); /* update lastAcquired time */
467474
numSent++;
468475
queue.addFirst(ch);

0 commit comments

Comments
 (0)