Sentinel Node Tree Lack | 调用链 不完整

frebpwbc  于 2021-11-29  发布在  Java
关注(0)|答案(0)|浏览(218)

Issue Description

  • bug report*

Describe what happened (or what feature you want)

  • First, when I want to construct one invocation tree like following :

  • then, there is in-complete tree i get by invoking DefaultNode.printDefaultNode();
  • following is what i got:
Entry-entrance(t:0 pq:2.0 bq:0.0 tq:2.0 rt:3.5 1mp:2 1mb:0 1mt:2)
-nodeB(thread:0 pq:1.0 bq:0.0 tq:1.0 rt:0.0 1mp:1 1mb:0 1mt:1)
-nodeA(thread:0 pq:1.0 bq:0.0 tq:1.0 rt:7.0 1mp:1 1mb:0 1mt:1)
--nodeC(thread:0 pq:2.0 bq:0.0 tq:2.0 rt:0.0 1mp:2 1mb:0 1mt:2)

Describe what you expected to happen

  • I thing there must be something wrong with the design of NodeSelectSlot.
  • There should be a complete invocation tree.

How to reproduce it (as minimally and precisely as possible)

  • following is my testing code:
@Test
public void invocationChain() {
    Context context = ContextUtil.enter("entrance");

    nodeA();
    nodeB();

    context.getEntranceNode().printDefaultNode();
    context.exit();
}

private void nodeA() {
    if (SphO.entry("nodeA")) {
        try {
            nodeC();
        } finally {
            SphO.exit();
        }
    }
}

private void nodeB() {
    if (SphO.entry("nodeB")) {
        try {
            nodeC();
        } finally {
            SphO.exit();
        }
    }
}

private void nodeC() {
    if (SphO.entry("nodeC")) {
        try {
            System.out.println("nodeC");
        } finally {
            SphO.exit();
        }
    }
}

static {
    List<String> list = Lists.newArrayList(Arrays.asList("nodeA", "nodeB", "nodeC"));
    List<FlowRule> rules = Lists.newArrayList();
    for(String str : list) {
        FlowRule rule1 = new FlowRule();
        rule1.setResource(str);
        rule1.setCount(2);
        rule1.setGrade(RuleConstant.FLOW_GRADE_QPS);
        rule1.setLimitApp("default");
        rules.add(rule1);
    }
    FlowRuleManager.loadRules(rules);
}

Tell us your environment

  • java 1.8
  • Sentinel 1.8.2

Anything else we need to know?

  • nothing

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题