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

SofaRpcMetricsCollector可能产生npe #1459

Open
Just-CJ opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1460
Open

SofaRpcMetricsCollector可能产生npe #1459

Just-CJ opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1460

Comments

@Just-CJ
Copy link

Just-CJ commented Nov 12, 2024

Describe the bug

SofaRpcMetricsCollector收集指标数据时依赖了的部分上下文参数可能获取不到,可能导致npe

Expected behavior

rpc/common-default.log中无异常

Actual behavior

rpc/common-default.log中会出现npe错误

java.lang.NullPointerException: null
	at com.alipay.sofa.rpc.metrics.prometheus.SofaRpcMetricsCollector$PrometheusSubscriber.onEvent(SofaRpcMetricsCollector.java:249)
	at com.alipay.sofa.rpc.metrics.prometheus.SofaRpcMetricsCollector$PrometheusSubscriber.onEvent(SofaRpcMetricsCollector.java:229)
	at com.alipay.sofa.rpc.event.EventBus.handleEvent(EventBus.java:153)
	at com.alipay.sofa.rpc.event.EventBus.post(EventBus.java:123)
	at com.alipay.sofa.rpc.client.ClientProxyInvoker.invoke(ClientProxyInvoker.java:91)
	at com.alipay.sofa.rpc.api.GenericService_proxy_0.$genericInvoke(GenericService_proxy_0.java)
	at com.alipay.sofa.circus.common.GenericServiceTest.lambda$init$1(GenericServiceTest.java:66)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

  • SOFARPC version: 5.13.1
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@Just-CJ Just-CJ linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant