Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用Java agent不生效,通过arthas jad看对应的类,均已被transform,但是trace不到TtlRunnable和TransmittableThreadLocal的执行记录 #535

Closed
AlbertGithubAI opened this issue Aug 11, 2023 · 6 comments
Assignees
Labels
😖 no runnable reproducible demo 😵 please provide a simple runnable demo that reproduce the problem ❓question Further information is requested

Comments

@AlbertGithubAI
Copy link

AlbertGithubAI commented Aug 11, 2023

使用Java agent不生效,通过arthas jad看对应的类,均已被transform,但是trace不到TtlRunnable和TransmittableThreadLocal的执行记录。

运行环境为Tomcat容器,没有使用其它agent。还有没有其它方法来排查?

@oldratlee
Copy link
Member

通过arthas jad看对应的类,均已被transform

运行的业务逻辑上,TTL Agent是不是已经生效? @AlbertGithubAI

如果TTL Agent已经运行时已生效,则可能要看看

  • 工具(arthas)的使用
  • 或是trace是位置是否正确

@oldratlee oldratlee added the ❓question Further information is requested label Aug 11, 2023
@AlbertGithubAI
Copy link
Author

通过arthas jad看对应的类,均已被transform

运行的业务逻辑上,TTL Agent是不是已经生效? @AlbertGithubAI

如果TTL Agent已经运行时已生效,则可能要看看

  • 工具(arthas)的使用
  • 或是trace是位置是否正确

业务不生效,所以来排查具体的问题,使用agent版本为2.14.2。

@AlbertGithubAI
Copy link
Author

另外单独使用ExecutorServiceTtlWrapper是可以的,但是加上agent就会有问题。

@oldratlee
Copy link
Member

oldratlee commented Aug 11, 2023

业务不生效,所以来排查具体的问题,使用agent版本为2.14.2。

也注意确认一下,应用中使用的TTL库的版本是否为最新的。@AlbertGithubAI

  • 因为Tomcat涉及ClassLoader,可能生效的是应用中的库
  • TTL库版本中可能有影响的Bug

关于Tomcat下,TTL Agent的使用,有相关的 issue讨论,比如可以看看 @AlbertGithubAI

@oldratlee oldratlee added the 😖 no runnable reproducible demo 😵 please provide a simple runnable demo that reproduce the problem label Aug 11, 2023
@AlbertGithubAI
Copy link
Author

AlbertGithubAI commented Aug 16, 2023

arthas的jad是否会触发ThreadPoolExecutor类的retransform,通过打印Stack Trace发现在jad ThreadPoolExecutor之前没有TtlRunnable的堆栈,但是jad之后就有了,并且jad的结果显示已经被增强了。 @oldratlee

@AlbertGithubAI
Copy link
Author

看了一下arthas jad的原理,发现在排查java agent失效原因的时候不能使用jad命令,因为jad命令会重新触发retransform。

alibaba/arthas#763

@oldratlee oldratlee self-assigned this Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😖 no runnable reproducible demo 😵 please provide a simple runnable demo that reproduce the problem ❓question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants