-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
spring.data.redis.timeout
doesn't seems to work with ReactiveStringRedisTemplate
after upgrade to Spring Boot 3.1
#2698
Comments
To follow up, it seems that the issue has something to do with how public LettuceClientConfigurationBuilderCustomizer commandTimeoutBuilderCustomizer(
@Value("${spring.data.redis.timeout}") Duration timeout
) {
log.info("Redis command timeout configured");
return builder -> builder.commandTimeout(timeout);
} |
Have you tried inspecting the configuration of the command timeout at runtime when using the Spring Boot spring.data.redis.timeout property? You can do this by acquiring a reference to the Duration commandTimeout = lettuceConnectionFactory.getClientConfiguration()
.getCommandTimeout();
If this problem occurs after upgrading to Spring Boot In any case, upon reviewing the Spring Boot auto-configuration for (Spring Data) Redis (from here, and specifically this), we see the declaration of the Subsequently, the As you can see, the command timeout is applied to the client configuration that is used when constructing the connection factory. The "properties" come from the At last, any user-defined customizers are applied to the Of course, none of Spring Boot's auto-configuration is going to have any effect if you explicitly overrode and declared a However, given that you declared a user-defined, Spring Boot To verify, I confirmed the proper behavior of both Spring Data Redis and Spring Boot by writing a simple test class that uses Spring Boot Of course, I did not go on to test the |
If you can provide a small, simple example that reproduces your problem reliably in a Gist, I'd be happy to take a closer look. |
spring.data.redis.timeout
doesn't seems to work with ReactiveStringRedisTemplate
after upgrade to spring boot 3.1spring.data.redis.timeout
doesn't seems to work with ReactiveStringRedisTemplate
after upgrade to Spring Boot 3.1
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Bug Report
We are using
ReactiveStringRedisTemplate
to execute Lua script forhset
andexpire
operations.The timeout is set as 5s by setting
spring.data.redis.timeout
environment so that the command timeout exception to be thrown if Redis server takes more than 5s to execute the given Lua script.Current Behaviour
The call to
execute
method ofReactiveStringRedisTemplate
seems to be hang forever when the Redis server is not returning the result instead of throwing exception upon the configured timeout.Expected Behaviour
The timeout exception should be thrown if the Redis server is not returning within the configured timeout.
Supporting Information
The
Expected Behaviour
can be achievable by usingStringRedisTemplate
to execute the Lua script.The text was updated successfully, but these errors were encountered: