Pinpoint: Question about classloader

Created on 1 Nov 2019  ·  4Comments  ·  Source: pinpoint-apm/pinpoint

Hello team,I am learning about how pinpoint works. And I hava the following questions.

  1. why PinpointBootstrap class should be loaded by BootstrapClassLoader,why not SystemClassLoader?As we know, main class is loaded by SystemclassLoader.
  2. why modify the parent of AgentClassLoader to BootstrapClassLoader?why it can avoid deadlock and avoid library conflicts?how does it work?
  3. why plugins require a separate pluginsclassloader,why not use agentclassloader?
    Look forward to your reply,thanks.
question stale

Most helpful comment

  1. why PinpointBootstrap class should be loaded by BootstrapClassLoader,why not SystemClassLoader?As we know, main class is loaded by SystemclassLoader.

If the agent loads PinpointBootstrap into SystemCl, it cannot instrument the JDK class.
image

All 4 comments

  1. why PinpointBootstrap class should be loaded by BootstrapClassLoader,why not SystemClassLoader?As we know, main class is loaded by SystemclassLoader.

If the agent loads PinpointBootstrap into SystemCl, it cannot instrument the JDK class.
image

  1. why modify the parent of AgentClassLoader to BootstrapClassLoader?why it can avoid deadlock and avoid library conflicts?how does it work?

There is no circular dependency because ClassLoader hierarchy is much simpler.

image

image

  1. why plugins require a separate pluginsclassloader,why not use agentclassloader?

I think it is not good for plugin to access all APIs of Agent.

  • Advantages

    • Easy to manage API compatibility

      Only maintain compatibility with bootstrap APIs.

    • Better security

      Even if the library in the agent has a vulnerability, it is difficult for an attacker to attack.

      I have a lot of experience with RCE(Remote Code Execution) attack on struts2.

      Therefore, security is a top priority.

  • Disadvantages
      - Increase complexity

This issue/proposal has been automatically marked as stale because it hasn't had any recent activity. It will automatically be closed if no further activity occurs for 20days. If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Pinpoint Community.

Was this page helpful?
0 / 5 - 0 ratings