Skip to content

Commit 17beaef

Browse files
authored
Gh-10446: RedisLockRegistry stopRenew is not thread safe
Fixes: #10446 Signed-off-by: PiotrDuz <[email protected]> **Auto-cherry-pick to `6.5.x` & `6.4.x`**
1 parent 6746508 commit 17beaef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,9 @@ protected final boolean renew(long expireAfter) {
601601
}
602602

603603
protected final void stopRenew() {
604-
if (this.renewFuture != null) {
605-
this.renewFuture.cancel(true);
604+
ScheduledFuture<?> renewFutureToCancel = this.renewFuture;
605+
if (renewFutureToCancel != null) {
606+
renewFutureToCancel.cancel(true);
606607
this.renewFuture = null;
607608
}
608609
}

0 commit comments

Comments
 (0)