Skip to content

Commit

Permalink
HTTPCORE-754: StrictConnPool fails to correctly handle infinite reque…
Browse files Browse the repository at this point in the history
…st timeout
  • Loading branch information
ok2c committed Jul 4, 2023
1 parent 8f7a7c2 commit da565a8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ public synchronized PoolEntry<T, C> get(
final boolean acquiredLock;

try {
acquiredLock = this.lock.tryLock(requestTimeout.getDuration(), requestTimeout.getTimeUnit());
if (Timeout.isPositive(requestTimeout)) {
acquiredLock = this.lock.tryLock(requestTimeout.getDuration(), requestTimeout.getTimeUnit());
} else {
this.lock.lockInterruptibly();
acquiredLock = true;
}
} catch (final InterruptedException interruptedException) {
Thread.currentThread().interrupt();
future.cancel();
Expand Down

0 comments on commit da565a8

Please sign in to comment.