Re: Cross Thread plugin

2021-01-03 Thread Sheng Wu
True, we can't instrument the class the agent core is using already. This is a logic conflict. If we allow the instrumentation activated before the configuration initialization and core service booting, you have a chance to face runtime NPE or race condition. The core developer and plugin developer

Re: Cross Thread plugin

2021-01-03 Thread 智能平台
Also, The FileWriter has used ThreadPoolExecutor. If we want to enhance the ThreadPoolExecutor,make sure org.apache.skywalking.apm.agent.core.conf.SnifferConfigInitializer#IS_INIT_COMPLETED is false before we have enhanced the ThreadPoolExecutor. 在 2021/1/4 下午3:04,“Li BingLong(智能平台)” 写入:

Re: Cross Thread plugin

2021-01-03 Thread 智能平台
We can not carry the tracing context if we do not change the parameter. We must change the Runnable parameter of java.util.concurrent.Executor#execute to RunnableWrapper. But please note than it is different from that We use the RunnableWrapper in the user code. People do not need to change their

Re: Cross Thread plugin

2021-01-03 Thread Sheng Wu
About ThreadPoolExecutor, yes, you can instrument it. But as no change made on the parameter, where do you expect to carry the tracing context(Snapshot)? Sheng Wu 吴晟 Twitter, wusheng1108 Li BingLong(智能平台) 于2021年1月4日周一 下午2:40写道: > How about enhance an Executor(ThreadPoolExecutor or something si

Re: Cross Thread plugin

2021-01-03 Thread 智能平台
How about enhance an Executor(ThreadPoolExecutor or something similar) if we can not enhance Runnable. 发件人: Sheng Wu 日期: 2021年1月4日 星期一 下午2:30 收件人: "Li BingLong(智能平台)" 抄送: "dev@skywalking.apache.org" 主题: Re: Cross Thread plugin First, you could learn what is lambda really in Java :) You will

Re: Cross Thread plugin

2021-01-03 Thread Sheng Wu
First, you could learn what is lambda really in Java :) You will get the conclusion that is insane :P And about enhancing the Runnable, it is also very radical, as it is widely used in many places, even not in cross-thread scenarios. That is why we don't want to mass up the whole JVM Sheng Wu 吴晟 T

Cross Thread plugin

2021-01-03 Thread 智能平台
Hi! I have seen the pr. https://github.com/apache/skywalking/pull/845 Frankly, this plugin is invasive compared to other plugins. We must write hard code with RunnableWrapper to use it. Why not enhance the Runnable class? This way we need to support lambda expression.