-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoundedAsyncPool doesn't work with a negative maxTotal #1181
Comments
There's no support for |
Yeah I figured it might have been intended that way. Unfortunately the pool configuration declared through Spring's properties is used for both sync and async pools. For now we've changed our Thanks |
Lettuce now adapts negative pool limits for the async pool to Integer.MAX_VALUE when using GenericObjectPoolConfig to align with the behavior of Commons Pool 2.
Lettuce now adapts negative pool limits for the async pool to Integer.MAX_VALUE when using GenericObjectPoolConfig to align with the behavior of Commons Pool 2.
Lettuce now adapts negative pool limits for the async pool to Integer.MAX_VALUE when using GenericObjectPoolConfig to align with the behavior of Commons Pool 2.
That's fixed now. |
Bug Report
Current Behavior
When using the
BoundedAsyncPool
with a negativemaxTotal
, new pool objects are not created. Trying to acquire a new object will fail withio.lettuce.core.RedisException: java.util.NoSuchElementException: Pool exhausted
This can be reproduced by creating a pool with the following config:
Input Code
I've added 2 unit tests to
BoundedAsyncPoolUnitTests
based on the5.2.x
branch to demonstrate the failures:https://github.com/lettuce-io/lettuce-core/compare/5.2.x...sguillope:bounded-async-pool-with-negative-max-total?expand=1
shouldCreateObjectWhenMaxTotalIsNegative
fails withshouldCreateMinIdleObjectWhenMaxTotalIsNegative
fails withExpected behavior/code
minIdle
config when the pool is initialisedacquire()
Environment
Additional context
We found this issue after upgrading from SB 2.1 to 2.2.1 and to Spring Data Redis 2.2.1. We use the following Spring
application.yml
-based Redis config:When we upgraded our healthcheck (which include the redis component) started failing. Debugging found that
java.util.NoSuchElementException: Pool exhausted
was being thrown inRedisReactiveHealthIndicator
.The text was updated successfully, but these errors were encountered: