sofa-ark
sofa-ark copied to clipboard
AgentClassLoader导致Container类加载范围增大
ContainerClassLoader 类加载行为
- 如果是 ark export 的类,委托应用类加载器加载(本地启动为AppClassLoader、SpringBoot启动LaunchedURLClassLoader)
- 如果点1没找到,ContainerClassLoader 自身加载 sofa-ark-all 中的类
在修复 Fix skywalking agent issues 后
ContainerClassLoader 类加载行为,改变为:
- 如果是 ark export 的类,委托应用类加载器加载(本地启动为AppClassLoader、SpringBoot启动LaunchedURLClassLoader)
- 如果点1没找到,ContainerClassLoader 自身加载 sofa-ark-all 中的类
- 如果点2没找到,委托AgentClassLoader加载(AgentClassLoader的parent为应用类加载器)
点3导致类加载的范围扩大到最终兜底走应用类加载器
com.alipay.sofa.ark.bootstrap.AbstractLauncher#createContainerClassLoade 中 设置AgentClassLoader.parent = SystemClassLoader 可以避免在 spring boot fat jar 启动时扩大范围,但不可解决 本地启动
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions.