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

AgentClassLoader导致Container类加载范围增大 #808

Open
yuanyuancin opened this issue Dec 12, 2023 · 3 comments
Open

AgentClassLoader导致Container类加载范围增大 #808

yuanyuancin opened this issue Dec 12, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@yuanyuancin
Copy link
Collaborator

ContainerClassLoader 类加载行为

  1. 如果是 ark export 的类,委托应用类加载器加载(本地启动为AppClassLoader、SpringBoot启动LaunchedURLClassLoader)
  2. 如果点1没找到,ContainerClassLoader 自身加载 sofa-ark-all 中的类

在修复 Fix skywalking agent issues

ContainerClassLoader 类加载行为,改变为:

  1. 如果是 ark export 的类,委托应用类加载器加载(本地启动为AppClassLoader、SpringBoot启动LaunchedURLClassLoader)
  2. 如果点1没找到,ContainerClassLoader 自身加载 sofa-ark-all 中的类
  3. 如果点2没找到,委托AgentClassLoader加载(AgentClassLoader的parent为应用类加载器)

点3导致类加载的范围扩大到最终兜底走应用类加载器

@yuanyuancin
Copy link
Collaborator Author

com.alipay.sofa.ark.bootstrap.AbstractLauncher#createContainerClassLoade 中 设置AgentClassLoader.parent = SystemClassLoader 可以避免在 spring boot fat jar 启动时扩大范围,但不可解决 本地启动

Copy link

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.

@github-actions github-actions bot added the stale label Jan 13, 2024
@lvjing2 lvjing2 removed the stale label Jan 13, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Feb 13, 2024
@lvjing2 lvjing2 added help wanted Extra attention is needed and removed stale labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants