You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/08/04 07:04:27 UTC

[GitHub] [skywalking] furaul opened a new issue #7407: Is rebase strategy of ByteBuddy in SkyWalking compatiable with javassist in other java agent tools? can it be solved?

furaul opened a new issue #7407:
URL: https://github.com/apache/skywalking/issues/7407


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [x] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   I am developing a threading plugin to make it possible to trace cross threads. Other than current trace-cross-thread implementations in SkyWalking, my implementation enhanced ThreadPoolExecutor and ForkJoinTask, like alibaba transmitable-thread-local, and I have encountered a problem.
   
   In my plugin, the ForkJoinTask constructor has been enhanced, I found that SkyWalking create a new constructor with ByteBuddy, and the parameter of this new construtor is a generated class with random names, like this.
   
   ```
       public ForkJoinTask() {
           this(null);
           ForkJoinTaskConstructorInterceptor_internal.intercept(this, (Object[])new Object[0]);
       }
   
       private /* synthetic */ ForkJoinTask(auxiliary.MtewiML4 mtewiML4) {
   
       }
   ```
   
   I realized that the rebase strategy is used in Byte-Buddy in SkyWalking.
   When javassist in transmitable-thread-local enhance the ForkJoinTask that has been enhanced by SkyWalking, the class named auxiliary.MtewiML4 could not be found, because it is generated by SkyWalking.
   
   I want to slove this problem, and I have got three solutions.
   
   1. Use redefine strategy of Byte-Buddy in SkyWalking(I dont know why SkyWalking using rebase strategy, and I am not sure what it really effects when I changed it.)
   2. Avoid enhanced private construtors of ForkJoinTask in transmitable-thread-local (This solution makes TTL compatible, but I have to change javassist code)
   3. Do not enhance ForkJoinTask, enhance ForkJoinPool or some classes else. (This may solve my problem, but the compatible problem is still unresolved)
   
   What is your opinion?
   ___
   ### Bug
   - Which version of SkyWalking, OS, and JRE?
   - 8.2.0 OSX java1.8
   
   - Which company or project?
   - Didi
   
   - What happened?
   If possible, provide a way to reproduce the error. e.g. demo application, component version.
   The enhanced code is not compatible.
   ___
   ### Requirement or improvement
   - Please describe your requirements or improvement suggestions.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #7407: Is rebase strategy of ByteBuddy in SkyWalking compatiable with javassist in other java agent tools? can it be solved?

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7407:
URL: https://github.com/apache/skywalking/issues/7407#issuecomment-892466133


   Your problem, so you need to submit a pull request to fix it. There is nothing about `could` or `could not`. 
   An agent to avoid trace-cross-thread is provided by the community for months, https://skywalking.apache.org/blog/2021-02-09-skywalking-trace-threadpool/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #7407: Is rebase strategy of ByteBuddy in SkyWalking compatiable with javassist in other java agent tools? can it be solved?

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7407:
URL: https://github.com/apache/skywalking/issues/7407#issuecomment-892420321


   > Use redefine strategy of Byte-Buddy in SkyWalking(I dont know why SkyWalking using rebase strategy, and I am not sure what it really effects when I changed it.)
   
   You should not change this strategy, we choose this for a long history. This is a better way to do so.
   
   > Avoid enhanced private construtors of ForkJoinTask in transmitable-thread-local (This solution makes TTL compatible, but I have to change javassist code)
   > Do not enhance ForkJoinTask, enhance ForkJoinPool or some classes else. (This may solve my problem, but the compatible problem is still unresolved)
   
   What you have done, is your private codes. A TLP should not change anything because of a private codebase. This is a principle of an open source project. Especially this thing doesn't benefit the community at all.
   
   The thing you do in your agent, could be done natively in SkyWalking's agent system. You should adopt a community, rather than ask a large community to adopt you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #7407: Is rebase strategy of ByteBuddy in SkyWalking compatiable with javassist in other java agent tools? can it be solved?

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #7407:
URL: https://github.com/apache/skywalking/issues/7407


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] furaul commented on issue #7407: Is rebase strategy of ByteBuddy in SkyWalking compatiable with javassist in other java agent tools? can it be solved?

Posted by GitBox <gi...@apache.org>.
furaul commented on issue #7407:
URL: https://github.com/apache/skywalking/issues/7407#issuecomment-892464179


   I just want to find a way to solve my problem, changing the strategy is not my purpose. 
   
   In other words, maybe my problem does not need to be solved, if it is possible to meet my demands with Skywalking‘s agent.
   
   1. Could ForkJoinTask be supported in Skywalking’s agent system in Skywalking-8.8.0? (I found that it is not supported in 8.2.0)
   2. Could trace-cross-thread be supported without any code modify in custom projects? (The @TraceCrossThread need code modify, the jdk-threading-plugin need THREADING_CLASS_PREFIXES config)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org