-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Connection failures and application hangs with RedisLockRegistry since Spring Boot upgrade #3805
Comments
Hi @Meteorkor! Would you mind taking a look here? Thank you! |
I looked at the "RedisMessageListenerContainer fail logs" posted by the author. @hameno In ElastiCache Redis (6.0.5) |
No, there are no additional logs during startup.
I don't understand what you mean by this. Can you explan in more detail? |
I think he means to start Redis subscription manually for that your environment: https://docs.spring.io/spring-data/data-redis/docs/current/reference/html/#redis:pubsub:subscribe. The point is that starting with version Since you claim that everything works well without Pub/Sub, then it only might be some configuration on the Redis server: we just use the same connection factory for Pub/Sub without any modifications:
Any chances that you can use Spring Data
So, that would give us a little more info about your problem. We cannot upgrade Spring Integration |
Thanks for looking into it - I'm currently finishing up something else but will try your suggestions soon and comment back |
I just re-read the official Spring Data documentation and noticed this block:
Since we use RedisStaticMasterReplicaConfiguration, this simply does not work with ElastiCache Redis. |
Thanks, @hameno , for investigation! Well, that does not sound good for our solution then... would you mind revising our |
@artembilan If Or there seems to be a way to select the lock/unlock method when creating ReidsLockRegistry. |
Well, I would like to have a "try and fallback if any". However let's see if a dedicated Looks like Redison has a dedicated non-pub/sub impl instead: https://github.com/redisson/redisson/blob/master/redisson/src/main/java/org/redisson/RedissonSpinLock.java ... |
I tested RedisMessageListenerContainer and RedisLockRegistry with "RedisClusterConfiguration" and it was confirmed that they work normally. |
I looked up why Is it better to return to the spinLock method considering the cluster environment? |
Thank you, @Meteorkor , for looking into this!
Does it mean that this even works with the mentioned ElastiCache Redis regardless of the not on the
? Anyway, according to that article about WDYT? |
No, I couldn't test because I couldn't build an environment that can configure RedisStaticMasterReplicaConfiguration. Perhaps as hameno said, pub/sub doesn't seem to work in RedisStaticMasterReplicaConfiguration. I just wanted to say that there was no problem with pub/sub operation in RedisClusterConfiguration as well as RedisStandaloneConfiguration. As you said, it would be good to make it work with spinLock method. I think it would be better to support the operation without pub/sub as part of the environment where pub/sub cannot be used(spinLock=true). |
thank you for confirmation. Any chances you can contribute the fix? |
I'll fix it and post a PR. |
Fixes #3805 The Redis Pub-Sub doesn't work in all the environment, therefore there has to be a choice to use old busy-spin algorithm * Change to select between spinLock method and pub-sub method * Make spinLock as a default one to let the `RedisLockRegistry` work everywhere * Fix javadoc, convention, lazy init * Fix javadoc, convention * Code clean up and docs for `RedisLockType` feature **Cherry-pick to 5.5.x**
In what version(s) of Spring Integration are you seeing this issue?
5.5.11
Describe the bug
We've just recently updated Spring Boot from 2.5.5 to 2.5.13 (so basically upgrade from 5.5.4 to 5.5.11).
Immediately we received constant connection failure logs:
The application also randomly hangs for multiple seconds.
We are using RedisLockRegistry with a ElastiCache Redis (6.0.5) in Primary/Replica mode. For RedisLockRegistry we only connect to the primary.
Our configuration is basically this:
We had to downgrade back to 2.5.5 to fix the issues for now
To Reproduce
Not sure
Expected behavior
No hangs / error logs
Sample
Not sure how to show
The text was updated successfully, but these errors were encountered: