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

Optimize service conflict error message #666

Closed

Conversation

wongtp
Copy link

@wongtp wongtp commented Jan 19, 2024

Optimize service conflict error message

see like intercept failure, sometimes the service conflict will print the error message to the skywalking-api.log, but not enough to find which service conflict.

before optimize

INFO 2024-01-18 13:41:21.946 main SkyWalkingAgent : Skywalking agent transformer has installed. 
ERROR 2024-01-18 13:41:22.270 main SkyWalkingAgent : Skywalking agent boot failure. 
org.apache.skywalking.apm.agent.core.boot.ServiceConflictException: Service class org.apache.skywalking.apm.plugin.cpu.policy.TraceSamplerCpuPolicyExtendService overrides conflict, exist more than one service want to override :class org.apache.skywalking.apm.agent.core.sampling.SamplingService
	at org.apache.skywalking.apm.agent.core.boot.ServiceManager.loadAllServices(ServiceManager.java:89)
	at org.apache.skywalking.apm.agent.core.boot.ServiceManager.boot(ServiceManager.java:42)
	at org.apache.skywalking.apm.agent.SkyWalkingAgent.premain(SkyWalkingAgent.java:142)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)

after optimize

INFO 2024-01-18 22:21:14.458 main SkyWalkingAgent : Skywalking agent transformer has installed. 
ERROR 2024-01-18 22:21:14.754 main SkyWalkingAgent : Skywalking agent boot failure. 
org.apache.skywalking.apm.agent.core.boot.ServiceConflictException: Service class org.apache.skywalking.apm.plugin.cpu.policy.TraceSamplerCpuPolicyExtendService overrides conflict, more then one service found, service[class org.apache.skywalking.apm.agent.core.sampling.SamplingService] want to override[class org.apache.skywalking.apm.plugin.trace.ignore.TraceIgnoreExtendService], please check your plugins
	at org.apache.skywalking.apm.agent.core.boot.ServiceManager.loadAllServices(ServiceManager.java:92)
	at org.apache.skywalking.apm.agent.core.boot.ServiceManager.boot(ServiceManager.java:42)
	at org.apache.skywalking.apm.agent.SkyWalkingAgent.premain(SkyWalkingAgent.java:111)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)

optimize service conflict error message, see like[apache/skywalking#10991
some times the service conflict will print error message to the skywalking-api.log, but not enough to find which service conflict
@wongtp wongtp changed the title Update ServiceManager.java Optimize service conflict error message Jan 19, 2024
@lujiajing1126
Copy link
Contributor

I am confused why this is related to the apache/skywalking#10991?

The linked issue may be caused by version compatibility of the Netty plugin. It must not relevant to the kernel.

@wongtp
Copy link
Author

wongtp commented Jan 19, 2024

I am confused why this is related to the apache/skywalking#10991?

The linked issue may be caused by version compatibility of the Netty plugin. It must not relevant to the kernel.

@lujiajing1126 Because of plugins conflict, lead to the ServiceManager.bootedServices initial failure, then all intercept failure.

image
WXWorkCapture_17056561825966

@wu-sheng
Copy link
Member

@wongtp The argument is, that the reason of the changes is not clear. If you just want to enhance logs to make the conflicts more readable, I think it is OK to accept.
But the issue you are referring to, it is not clearly related to this change.

We need to keep the discussion context clear.

@wongtp
Copy link
Author

wongtp commented Jan 20, 2024

I am confused why this is related to the apache/skywalking#10991?

The linked issue may be caused by version compatibility of the Netty plugin. It must not relevant to the kernel.

@wu-sheng @lujiajing1126
I am so sorry, this was my mistake, I checked again the relate issue intercept failure, it should be relate to issues/11205, when ServiceManager.bootedServices initial failure, it will print many of NPE error message in skywalking-api.log, I hope this optimeize can help us to find the cause of the problem quickly.

@wu-sheng
Copy link
Member

@lujiajing1126 Could you recheck the new linked issue?

@wu-sheng wu-sheng added enhancement New feature or request and removed TBD labels Jan 21, 2024
@wu-sheng wu-sheng added this to the 9.2.0 milestone Jan 21, 2024
@lujiajing1126
Copy link
Contributor

lujiajing1126 commented Jan 22, 2024

I am confused why this is related to the apache/skywalking#10991?
The linked issue may be caused by version compatibility of the Netty plugin. It must not relevant to the kernel.

@wu-sheng @lujiajing1126 I am so sorry, this was my mistake, I checked again the relate issue intercept failure, it should be relate to issues/11205, when ServiceManager.bootedServices initial failure, it will print many of NPE error message in skywalking-api.log, I hope this optimeize can help us to find the cause of the problem quickly.

As I comment here, apache/skywalking#11205 (comment) is caused by misunderstanding of the webflux scenario.

I am going to close the issue since it actually resolves neither of the issues the author linked here.

Feel free to reopen this if you have further idea.

@wongtp
Copy link
Author

wongtp commented Jan 23, 2024

I am confused why this is related to the apache/skywalking#10991?
The linked issue may be caused by version compatibility of the Netty plugin. It must not relevant to the kernel.

@wu-sheng @lujiajing1126 I am so sorry, this was my mistake, I checked again the relate issue intercept failure, it should be relate to issues/11205, when ServiceManager.bootedServices initial failure, it will print many of NPE error message in skywalking-api.log, I hope this optimeize can help us to find the cause of the problem quickly.

As I comment here, apache/skywalking#11205 (comment) is caused by misunderstanding of the webflux scenario.

I am going to close the issue since it actually resolves neither of the issues the author linked here.

Feel free to reopen this if you have further idea.

@lujiajing1126 You are right, it can't resolve that problem and don't have much to do with each other 😂, but I hope this optimeize can help us to find the cause of the problem quickly when plugins conflict.

@lujiajing1126
Copy link
Contributor

@lujiajing1126 You are right, it can't resolve that problem and don't have much to do with each other 😂, but I hope this optimeize can help us to find the cause of the problem quickly when plugins conflict.

I agree this PR is a kind of optimization. But the changes here are totally irrelevant to the so-called "plugins conflict".

BootService is an internal service. Normally plugin developers and users do not implement their own BootServices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants