Skip to content

Commit

Permalink
Merge pull request #5820 from eclipse/jetty-9.4.x-5819-PoolArithmetic…
Browse files Browse the repository at this point in the history
…Exception

backport fix for ArithmeticException in Pool
  • Loading branch information
lorban committed Dec 17, 2020
2 parents 38f0fc4 + 4478233 commit d5648c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java
Expand Up @@ -301,6 +301,11 @@ public Entry acquire()
{
LOGGER.ignore(e);
size = entries.size();
// Size can be 0 when the pool is in the middle of
// acquiring a connection while another thread
// removes the last one from the pool.
if (size == 0)
break;
}
index = (index + 1) % size;
}
Expand Down

0 comments on commit d5648c7

Please sign in to comment.