From f3b1b126c89f139cbf5e29de62ee869e0ac382d2 Mon Sep 17 00:00:00 2001 From: mantuliu <240951888@qq.com> Date: Wed, 19 Feb 2020 19:38:24 +0800 Subject: [PATCH] Improve singleton logic in SendMetricCommandHandler (#1294) --- .../csp/sentinel/command/handler/SendMetricCommandHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java b/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java index b3692e14..033c0820 100755 --- a/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java +++ b/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java @@ -42,7 +42,7 @@ import com.alibaba.csp.sentinel.util.TimeUtil; + "startTime={startTime}&endTime={endTime}&maxLines={maxLines}&identify={resourceName}") public class SendMetricCommandHandler implements CommandHandler { - private MetricSearcher searcher; + private volatile MetricSearcher searcher; private final Object lock = new Object();