-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
In what version(s) of Spring Integration are you seeing this issue?
5.5.7.RELEASE (with spring boot version 2.6.2)
Describe the bug
Lock lock = redisLockRegistry.obtain(key);
boolean acquired = false;
try {
acquired = lock.tryLock(ttl, TimeUnit.MILLISECONDS);
if (!acquired) {
throw new RuntimeException(String.format("Failed to acquire lock [%s]", key));
}
// code
} catch (InterruptedException e) {
log.error(Throwables.getStackTraceAsString(e));
Thread.currentThread().interrupt();
throw new RuntimeException(String.format("Interrupted in locking [%s]", key));
} finally {
if (acquired) {
try {
lock.unlock();
} catch (Exception e) {
log.error(Throwables.getStackTraceAsString(e));
}
}
}
To Reproduce
After updating the version, acquired
is intermittently returned as false
in the following code.
When I measured the time, it is presumed that it probably took a timeout and returned false
.
It seems that unlock doesn't work properly locally, presumably intermittently.
There are several instances, but it seems that local lock release does not work properly as it only occurs on the instance with the upgraded version.
Expected behavior
A clear and concise description of what you expected to happen.
Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.