You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
long expire = now + TimeUnit.MILLISECONDS.convert(time, unit);
boolean acquired;
while (!(acquired = obtainLock()) && System.currentTimeMillis() < expire) { //NOSONAR
Thread.sleep(100); //NOSONAR
}
If a vm instance acquires a lock and persists for a long time, or if multiple vm instances try to acquire a lock, I think the part where obtainLock() is called continuously is wasteful.
Context
I would like to contribute to the project.
If it's okay with you, I'd like to write a PR and get a review.
The text was updated successfully, but these errors were encountered:
I’m not fully sure what solution you suggest, but opening PR and continue discussion over there won’t harm. If you have time to code your idea, of course…
thank you!
Meteorkor
added a commit
to Meteorkor/spring-integration
that referenced
this issue
Dec 13, 2021
ever since we have upgraded srping-integration-redis to 5.5.8 we are encountering the following error
Connection failure occurred. Restarting subscription task after 5000 ms
Although lock functionality is working fine . The error is coming from RedisMessageListenerContainer present within redis lock registry
Expected Behavior
Remove spinlock for used by RedisLockRegistry
So, I thought about how to improve this part through redis pub-sub.
Current Behavior
Currently, spinlock is used to acquire redis-lock.
https://github.com/spring-projects/spring-integration/blob/main/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java#L231-L233
https://github.com/spring-projects/spring-integration/blob/main/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java#L291-L298
If a vm instance acquires a lock and persists for a long time, or if multiple vm instances try to acquire a lock, I think the part where obtainLock() is called continuously is wasteful.
Context
I would like to contribute to the project.
If it's okay with you, I'd like to write a PR and get a review.
The text was updated successfully, but these errors were encountered: