Merge pull request #5732 from eclipse/jetty-10.0.x-5731-Pool-ArithmeticException
Fix ArithmeticException "/ by zero" in Pool.acquire()
This commit is contained in:
commit
df5622ecfc
|
@ -249,6 +249,11 @@ public class Pool<T> implements AutoCloseable, Dumpable
|
|||
{
|
||||
LOGGER.trace("IGNORED", 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue