From 77932701b6227d8dcc4e8ef27315b16f94ee0419 Mon Sep 17 00:00:00 2001 From: "tao.zhang" Date: Fri, 20 Sep 2019 15:30:03 +0800 Subject: [PATCH] Add volatile for the stop flag of watcher in ConsulDataSource (#1054) --- .../csp/sentinel/datasource/consul/ConsulDataSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentinel-extension/sentinel-datasource-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java b/sentinel-extension/sentinel-datasource-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java index 6dc4bf6e..5b193a85 100644 --- a/sentinel-extension/sentinel-datasource-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java +++ b/sentinel-extension/sentinel-datasource-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java @@ -133,7 +133,7 @@ public class ConsulDataSource extends AbstractDataSource { } private class ConsulKVWatcher implements Runnable { - private boolean running = true; + private volatile boolean running = true; @Override public void run() {