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 Sep 15, 2023
1 parent 4695f25 commit 0b126ee
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 0b126ee

Please sign in to comment.