You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect the issue's language is not English and translate it automatically.
Title: SermantClassLoader design consultation
What do you want to ask?
status quo
I compared the implementation of JavaAgent ClassLoader isolation between Sermant and OpenTelemetry.
Found a little difference: OpenTelemetry isolates JavaAgent and business code by setting the parent of AgentClassLoader to null. AgentClassLoader is loaded from its own classpath first, and if it cannot be loaded, it is loaded from BootStrapClassLoader.
However, the parent of Sermant's SermantClassLoader is AppClassLoader. It is loaded from its own classpath first. If it cannot be loaded, the parent delegates the loading (BootStrapClassLoader -> ExtClassLoader -> AppClassLoader process).
question
Please ask, why does SermantClassLoader deliberately not set parent to null? Wouldn't this better isolate business code? Or is it based on other considerations? Thanks for the reply (it should not affect Sermant’s PluginClassLoader, you can still directly obtain the host service class through the localLoader mechanism)
@JedrekWang This is to reuse the classes that have been loaded by the host application, ensuring that the SermantClassLoader does not need to be reloaded.
What do you want to ask?
现状
我对比了Sermant和OpenTelemetry关于JavaAgent ClassLoader隔离这块的实现
发现一点差异:OpenTelemetry通过将AgentClassLoader的parent设置为null,AgentClassLoader先从自己的classpath加载,加载不到从BootStrapClassLoader加载,来隔离JavaAgent和业务代码
但是Sermant的SermantClassLoader的parent为AppClassLoader,先从自己的classpath加载,加载不到走双亲委托加载(BootStrapClassLoader -> ExtClassLoader -> AppClassLoader流程)
问题
麻烦咨询一下,SermantClassLoader为啥故意没有将parent设置为null,这样不是可以更好的隔离业务代码吗?还是说有基于其他考虑?感谢答复(应该不影响Sermant的PluginClassLoader,仍然可以通过localLoader机制直接获取宿主服务的类)
The text was updated successfully, but these errors were encountered: