GithubHelp home page GithubHelp logo

Comments (7)

zifeihan avatar zifeihan commented on June 9, 2024

此时Task构造器先被增强,然而因为Task构造时RestStrategyContext尚未加载, 所以DiscoveryServicePlugin对应的ThreadLocalHook还未注册,Object[] objects = ThreadLocalCopier.create(), 此行代码objects结果为空, 灰度结果会异常.

即使这里为空的话,为什么灰度结果会异常呢?

from discoveryagent.

HaojunRen avatar HaojunRen commented on June 9, 2024

@yanbw 无法重现你说的问题,该测试用例集成在DiscoveryGuide上,经过测试,该问题似乎不存在,你是否可以通过DiscoveryGuide来重新你说的问题?参考https://github.com/Nepxion/DiscoveryGuide/blob/6.x.x/discovery-guide-service/src/main/java/com/nepxion/discovery/guide/service/feign/AFeignImpl.java中

    @Override
    @SentinelResource(value = "sentinel-resource", blockHandler = "handleBlock", fallback = "handleFallback")
    public String invokeThread(@PathVariable(value = "value") String value) {
        Runnable runnable = createRunnable(value);

        new Thread(runnable).start();

        return "Invoke Thread";
    }

from discoveryagent.

yanbw avatar yanbw commented on June 9, 2024

@HaojunRen @zifeihan
测试代码如下
image
启动a、b 1.0版本应用
image
应用启动后第一次调用(n-d-version = {"discovery-guide-service-b":1.1} )
image
调用结果
image
第二次调用
image
第二次调用结果,调不通(b应用1.1不存在,调不通才是正常结果)
image

from discoveryagent.

HaojunRen avatar HaojunRen commented on June 9, 2024

这个问题的确存在。原因是异步的时候, 初始化Agent相关类和业务调用基本同时开始。当业务调用先于Agent初始化完成,那么灰度不会生效。这种情况只会发生在第一次。我们考虑一下,怎么解决

from discoveryagent.

HaojunRen avatar HaojunRen commented on June 9, 2024

一个非技术角度的观点@yanbw

你的异步调用结果只是打印一句话,而真正生产环境的执行代码相对耗时较长,应该绝大多数情况是Agent初始化代码先执行完毕

from discoveryagent.

HaojunRen avatar HaojunRen commented on June 9, 2024

你是否在nepxion群里,请@我一下,或者加我微信1394997

from discoveryagent.

HaojunRen avatar HaojunRen commented on June 9, 2024

已发布Agent 1.2.0,解决了该问题

from discoveryagent.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.