You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
XiongMMaq
changed the title
多线程情况下,如果使用默认的context访问同一个resource时,使用的是同一个DefaultNode
多线程情况下,如果使用默认condexName的context访问同一个resource时,使用的是同一个DefaultNode
Mar 25, 2021
XiongMMaq
changed the title
多线程情况下,如果使用默认condexName的context访问同一个resource时,使用的是同一个DefaultNode
多线程情况下,如果使用默认contextName的context访问同一个resource时,使用的是同一个DefaultNode
Mar 25, 2021
图片中,这句话是不是描述的由问题?
没有认为设置contextName时,使用呢默认的:Constants.CONTEXT_DEFAULT_NAME(sentinel_default_context)
if (context == null) { // Using default context. context = InternalContextUtil.internalEnter(Constants.CONTEXT_DEFAULT_NAME); }
如下图在NodeSelectorSlot中,通过context.getName()获取DefaultNode
` DefaultNode node = map.get(context.getName());
if (node == null) {
synchronized (this) {
node = map.get(context.getName());
if (node == null) {
node = new DefaultNode(resourceWrapper, null);
HashMap<String, DefaultNode> cacheMap = new HashMap<String, DefaultNode>(map.size());
cacheMap.putAll(map);
cacheMap.put(context.getName(), node);
map = cacheMap;
// Build invocation tree
((DefaultNode) context.getLastNode()).addChild(node);
}
The text was updated successfully, but these errors were encountered: