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 Jun 30, 2023
1 parent 8f7a7c2 commit 277370d
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.lock();
acquiredLock = true;
}
} catch (final InterruptedException interruptedException) {
Thread.currentThread().interrupt();
future.cancel();
Expand Down

0 comments on commit 277370d

Please sign in to comment.