Tests with PubSub Messaging never ends when redis crash in 3.2.1 #2822
Labels
status: feedback-provided
Feedback has been provided
status: waiting-for-triage
An issue we've not yet triaged
Hi,
Since spring-data-redis 3.2.1, when running tests (with Redis PubSub Messaging), the process no longer ends if the instance of redis crash. In 3.2.0, the test process ends well.
After some research, it seems that a cause could be this commit . When the connection fails:
handleSubscriptionException
of the classRedisMessageListenerContainer
which is callingpotentiallyRecover
functionpotentiallyRecover
function, there is a call torecoveryFunction
recoveryFunction
is callinglazyListen
lazyListen
function, there is a call todoSubscribe
function in a while loopdoSubscribe
is calling the functioninitialize
RuntimeException
and a call is made to functionhandleSubscriptionException
, so we return to step 1 and there is a loopI tried to make a quick and simple app to be able to test and reproduce the problem:
docker compose up
)KafkaApplicationTests4
KafkaApplicationTests4
is running, kill the redis processSample output with version 3.2.0 with a "BUILD SUCCESSFUL in 43s"
320.txt
In 3.2.1, the process never ends because of the loop (in this case I waited 3min) :
321.txt
When I set a FixedBackOff with a maxAttempts value on
RedisMessageListenerContainer
withsetRecoveryBackoff
, it ends because he reaches the number of attempts when calling nextBackOff. Is it a workaround or is it the right way to do ?The text was updated successfully, but these errors were encountered: