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

TTL 的 java agent 模式与dragonwell 的 eagerappcds有冲突 #642

Open
CodeWeaver13 opened this issue May 7, 2024 · 5 comments
Open
Labels
😖 no runnable reproducible demo 😵 please provide a simple runnable demo that reproduce the problem ttl agent

Comments

@CodeWeaver13
Copy link

eagerappcds 在 trace 阶段正常,replay 阶段会出现Bootstrap loader class path中期望的 jar 顺序与实际顺序不一致的情况。

java -server -javaagent:/transmittable-thread-local-2.13.0-SNAPSHOT.jar -XX:-OmitStackTraceInFastThrow -XX:+TraceClassPaths -Xquickstart:path=/root/alibaba.quickstart.sharedcache  -Xquickstart:verbose -Dzeusrpc-appkey=moqipobing.wanba.report -Dwb.appname=report -Dserver.port=80 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dmicroserver.host=0.0.0.0 -Dmicroserver.port=80 -Dlog4j.log.dir=80 -Dmicroserver.maxThreads=400 -Dmicroserver.minThreads=50 -Dmicroserver.queueCapacity=12000 -Dmicroserver.queueGrowBy=100 -Dfastjson.parser.safeMode=true -Dwb.env=develop -jar /tmp/test.jar
[classpath: /tmp/test.jar]
cache path is set from -Xquickstart:path=/root/alibaba.quickstart.sharedcache
Running as replayer
[Bootstrap loader class path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.13.0-SNAPSHOT.jar]
[type=BOOT Expecting -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar]
[BOOT classpath mismatch, actual: -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.13.0-SNAPSHOT.jar]
An error has occurred while processing the shared archive file.
shared class paths mismatch (hint: enable -XX:+TraceClassPaths to diagnose the failure)
Error occurred during initialization of VM
Unable to use shared archive.
@CodeWeaver13 CodeWeaver13 changed the title TTL 的 java agent 模式与dragonwell 的 eagerappcds有冲突 label:agent TTL 的 java agent 模式与dragonwell 的 eagerappcds有冲突 May 7, 2024
@CodeWeaver13 CodeWeaver13 changed the title label:agent TTL 的 java agent 模式与dragonwell 的 eagerappcds有冲突 TTL 的 java agent 模式与dragonwell 的 eagerappcds有冲突 May 7, 2024
@oldratlee
Copy link
Member

oldratlee commented May 7, 2024

@wangshiyu13 会不会加其它Java Agent(自动加bootclasspath)也有这个问题?

显式加上-Xbootclasspath/a:path/to/transmittable-thread-local-2.x.y.jar试试

@CodeWeaver13
Copy link
Author

@wangshiyu13 会不会加其它java agent(会自动加bootclasspath)也有这个问题?

显式加上-Xbootclasspath/a:path/to/transmittable-thread-local-2.x.y.jar试试

测试过 otel 或者 skywalking 的 agent 没有冲突
显式加上 bootclasspath 会出现加载两次的问题,最后一样会报classpath mismatch

@oldratlee
Copy link
Member

oldratlee commented May 18, 2024

@wangshiyu13

  • 请提供一个 极简、可运行、复现问题的 代码Demo工程。
  • 包含 otel 或者 skywalking Agent 没有冲突。

推荐提供成一个单独的工程(GitHub repo)。这样可以:

  • 方便大家能排查分析;只提供片段代码、运行问题概述,排查信息不足
  • 方便分离不相关的业务实现内容,以及排除可能的业务使用问题
    如使用配置问题、其它业务代码的意外影响

@oldratlee oldratlee added 😖 no runnable reproducible demo 😵 please provide a simple runnable demo that reproduce the problem ttl agent labels May 18, 2024
@CodeWeaver13
Copy link
Author

测试 demo 在这:https://github.com/wangshiyu13/ttl-dw-agent-demo

dragonwell-8.18.19文件夹内是 dw-jvm

java 启动参数
java -javaagent:/transmittable-thread-local-2.14.5.jar=ttl.agent.logger:STDOUT -javaagent:/agent-1.0-SNAPSHOT-all.jar -Xbootclasspath/a:/transmittable-thread-local-2.14.5.jar -XX:-OmitStackTraceInFastThrow -XX:+TraceClassPaths -Xquickstart:path=/root/alibaba.quickstart.sharedcache -Xquickstart:verbose -jar /ttl-agent-demo-1.0.0-SNAPSHOT.jar

报错内容如下:
root@common-ops-7b69b56c5f-sbjp2:/# java -javaagent:/transmittable-thread-local-2.14.5.jar=ttl.agent.logger:STDOUT -javaagent:/agent-1.0-SNAPSHOT-all.jar -Xbootclasspath/a:/transmittable-thread-local-2.14.5.jar -XX:-OmitStackTraceInFastThrow -XX:+TraceClassPaths -Xquickstart:path=/root/alibaba.quickstart.sharedcache -Xquickstart:verbose -jar /ttl-agent-demo-1.0.0-SNAPSHOT.jar [classpath: /ttl-agent-demo-1.0.0-SNAPSHOT.jar] cache path is set from -Xquickstart:path=/root/alibaba.quickstart.sharedcache Running as replayer [Bootstrap loader class path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.14.5.jar] [type=BOOT Expecting -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar] [BOOT classpath mismatch, actual: -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.14.5.jar] An error has occurred while processing the shared archive file. shared class paths mismatch (hint: enable -XX:+TraceClassPaths to diagnose the failure) Error occurred during initialization of VM Unable to use shared archive.

如果在 ttl 的 jar 包打包时去掉Boot-Class-Path,则可以指定 bootclasspath 运行,但是 agent 貌似未成功

@CodeWeaver13
Copy link
Author

CodeWeaver13 commented Jun 20, 2024

@oldratlee demo 已提供,地址https://github.com/wangshiyu13/ttl-dw-agent-demo

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 ttl agent
Projects
None yet
Development

No branches or pull requests

2 participants