Fix deadlock bug in Env static initialization (#610)
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
This commit is contained in:
parent
f60394c651
commit
7feaf709fc
|
|
@ -41,7 +41,7 @@ public final class Constants {
|
|||
public final static String TOTAL_IN_RESOURCE_NAME = "__total_inbound_traffic__";
|
||||
|
||||
public final static DefaultNode ROOT = new EntranceNode(new StringResourceWrapper(ROOT_ID, EntryType.IN),
|
||||
Env.nodeBuilder.buildClusterNode());
|
||||
new ClusterNode());
|
||||
|
||||
/**
|
||||
* Statistics for {@link SystemRule} checking.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@ import com.alibaba.csp.sentinel.node.DefaultNodeBuilder;
|
|||
import com.alibaba.csp.sentinel.node.NodeBuilder;
|
||||
|
||||
/**
|
||||
* Sentinel Env. This class will trigger all initialization for Sentinel.
|
||||
*
|
||||
* <p>
|
||||
* NOTE: to prevent deadlocks, other classes' static code block or static field should
|
||||
* NEVER refer to this class.
|
||||
* </p>
|
||||
*
|
||||
* @author jialiang.linjl
|
||||
*/
|
||||
public class Env {
|
||||
|
|
|
|||
Loading…
Reference in New Issue