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

[Bug] skywalking agent #11675

Closed
2 of 3 tasks
wangkang4 opened this issue Dec 19, 2023 · 11 comments
Closed
2 of 3 tasks

[Bug] skywalking agent #11675

wangkang4 opened this issue Dec 19, 2023 · 11 comments
Labels
bug Something isn't working and you are sure it's a bug! duplicate This issue or pull request already exists

Comments

@wangkang4
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

java agent version:9.0.0
arthas:3.7.1
The arthas retransform command is used to hot-load the class file. A retransform error message is displayed. java.lang.UnsupportedOperationException: class redefinition failed: attempted to change superclass or interfaces

What you expected to happen

The arthas hot-load class file function is not affected.

How to reproduce

3221702973608_ pic

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@wangkang4 wangkang4 added the bug Something isn't working and you are sure it's a bug! label Dec 19, 2023
@wu-sheng
Copy link
Member

duplicated reported.

@wu-sheng wu-sheng added the duplicate This issue or pull request already exists label Dec 19, 2023
@wu-sheng wu-sheng closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@wu-sheng
Copy link
Member

follow #11651

@wangkang4
Copy link
Author

Hello, does skywalking support arthas' retransform command? After the configuration of agent.is_cache_enhanced_class and agent.class_cache_mode is enabled, the redefine command is successfully executed, but the retransform command fails. Using the jad command, you found that skywalking added properties and methods to the class.

@wu-sheng
Copy link
Member

We don't support it officially. As you can see on #11651, someone may have an interest in doing as best as they can. You could try that PR version.

@lujiajing1126
Copy link
Contributor

Hello, does skywalking support arthas' retransform command? After the configuration of agent.is_cache_enhanced_class and agent.class_cache_mode is enabled, the redefine command is successfully executed, but the retransform command fails. Using the jad command, you found that skywalking added properties and methods to the class.

IIRC, IS_CACHE_ENHANCED_CLASS flag has been removed since SkyWalking Agent 9.0

@wangkang4
Copy link
Author

arthas' hot-load class file commands, such as redefine and retransform, are not currently supported by the services monitored by skywalking, right?

@wangkang4
Copy link
Author

Hello, does skywalking support arthas' retransform command? After the configuration of agent.is_cache_enhanced_class and agent.class_cache_mode is enabled, the redefine command is successfully executed, but the retransform command fails. Using the jad command, you found that skywalking added properties and methods to the class.

IIRC, IS_CACHE_ENHANCED_CLASS flag has been removed since SkyWalking Agent 9.0

How to modify skywalking javaagent to support arthas hot load class command, is there a case code?

@lujiajing1126
Copy link
Contributor

Hello, does skywalking support arthas' retransform command? After the configuration of agent.is_cache_enhanced_class and agent.class_cache_mode is enabled, the redefine command is successfully executed, but the retransform command fails. Using the jad command, you found that skywalking added properties and methods to the class.

IIRC, IS_CACHE_ENHANCED_CLASS flag has been removed since SkyWalking Agent 9.0

How to modify skywalking javaagent to support arthas hot load class command, is there a case code?

As you may notice in apache/skywalking-java#659, we are still working on this topic. I suppose after that PR, we may stabilize this feature.

Feel free to test this PR for your use cases. Feedback is welcome.

@wangkang4
Copy link
Author

Is arthas' redefine and retransform commands not currently supported for modifying the target class? Because skywalking's javaagent adds a few new methods to the target class.

@wangkang4
Copy link
Author

wangkang4 commented Dec 22, 2023

Hello, does skywalking support arthas' retransform command? After the configuration of agent.is_cache_enhanced_class and agent.class_cache_mode is enabled, the redefine command is successfully executed, but the retransform command fails. Using the jad command, you found that skywalking added properties and methods to the class.

IIRC, IS_CACHE_ENHANCED_CLASS flag has been removed since SkyWalking Agent 9.0

How to modify skywalking javaagent to support arthas hot load class command, is there a case code?

As you may notice in apache/skywalking-java#659, we are still working on this topic. I suppose after that PR, we may stabilize this feature.

Feel free to test this PR for your use cases. Feedback is welcome.

Why does a javaagent using skywalking generate so many classes with $? Using arthas's trace command, we looked at the call chain and found that the generated proxy classes were all executed.
WechatIMG328

WechatIMG326

@wu-sheng
Copy link
Member

That is why your codes could be traced and monitored.
Your codes are changed by the agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working and you are sure it's a bug! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants