From 5c0fd5651acf84fa29b75a95a464bec96556bfd7 Mon Sep 17 00:00:00 2001 From: mjaow Date: Wed, 30 Jan 2019 10:25:16 +0800 Subject: [PATCH] Add volatile in double-checked locking field in ClusterBuilderSlot (#466) --- .../csp/sentinel/slots/clusterbuilder/ClusterBuilderSlot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/clusterbuilder/ClusterBuilderSlot.java b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/clusterbuilder/ClusterBuilderSlot.java index 31ef6b65..acbc3895 100755 --- a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/clusterbuilder/ClusterBuilderSlot.java +++ b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/clusterbuilder/ClusterBuilderSlot.java @@ -70,7 +70,7 @@ public class ClusterBuilderSlot extends AbstractLinkedProcessorSlot private static final Object lock = new Object(); - private ClusterNode clusterNode = null; + private volatile ClusterNode clusterNode = null; @Override public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count,