mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 14:35:04 +00:00
Core: Fix NPE. The future
field is set from a different thread.
Closes #10630
This commit is contained in:
parent
af191d7888
commit
161e74029f
@ -525,7 +525,7 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
|
|||||||
class NotifyTimeout implements Runnable {
|
class NotifyTimeout implements Runnable {
|
||||||
final TimeoutClusterStateListener listener;
|
final TimeoutClusterStateListener listener;
|
||||||
final TimeValue timeout;
|
final TimeValue timeout;
|
||||||
ScheduledFuture future;
|
volatile ScheduledFuture future;
|
||||||
|
|
||||||
NotifyTimeout(TimeoutClusterStateListener listener, TimeValue timeout) {
|
NotifyTimeout(TimeoutClusterStateListener listener, TimeValue timeout) {
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
@ -538,7 +538,7 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (future.isCancelled()) {
|
if (future != null && future.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lifecycle.stoppedOrClosed()) {
|
if (lifecycle.stoppedOrClosed()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user