GH-8869: Fix NPE in RedisLockRegistry.setExecutor

Fixes: #8869

Do not set the `redisMessageListenerContainer`'s executor in the setter method
since the Redis Message Listener container is not initialised during configuration due to lazy loading

**Cherry-pick to `6.2.x` & `6.0.x`**
This commit is contained in:
Neville Bonavia
2024-01-26 02:31:21 -05:00
committed by Artem Bilan
parent 35f3a87109
commit 62fd3e6c20
2 changed files with 12 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2023 the original author or authors.
* Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -198,8 +198,6 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl
public void setExecutor(Executor executor) {
this.executor = executor;
this.executorExplicitlySet = true;
this.redisMessageListenerContainer.setTaskExecutor(this.executor);
this.redisMessageListenerContainer.setSubscriptionExecutor(this.executor);
}
/**