apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.55k stars 26.44k forks source link

[Bug] dubbo Provider列表变更通知consumer 消费端 出现NullPointerException bug #14196

Open smalltalkhyb opened 6 months ago

smalltalkhyb commented 6 months ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.2.11 JDK 17

Steps to reproduce this issue

上线发布 Dubbo 服务提供者,服务提供者和消费者都只有一个POD实例

What you expected to happen

time: 2024-05-16T10:17:12.878479339+08:00 content: 2024-05-16 10:17:12,877 ERROR [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] [TRACEID:] [c.a.n.c.n.NotifyCenter:208]}: Event callback exception: java.lang.NullPointerException: null at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1693) ~[?:?] at org.apache.dubbo.registry.client.DefaultServiceInstance.toURL(DefaultServiceInstance.java:294) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.getServiceUrlsCache(ServiceInstancesChangedListener.java:407) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.lambda$doOnEvent$5(ServiceInstancesChangedListener.java:234) ~[dubbo-3.2.11.jar!/:3.2.11] at java.util.HashMap.computeIfAbsent(HashMap.java:1220) ~[?:?] at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.doOnEvent(ServiceInstancesChangedListener.java:232) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.onEvent(ServiceInstancesChangedListener.java:125) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.nacos.NacosServiceDiscovery.handleEvent(NacosServiceDiscovery.java:245) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.nacos.NacosServiceDiscovery.access$000(NacosServiceDiscovery.java:65) ~[dubbo-3.2.11.jar!/:3.2.11] at org.apache.dubbo.registry.nacos.NacosServiceDiscovery$NacosEventListener.onEvent(NacosServiceDiscovery.java:217) ~[dubbo-3.2.11.jar!/:3.2.11] at com.alibaba.nacos.client.naming.event.InstancesChangeNotifier.onEvent(InstancesChangeNotifier.java:126) ~[nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.client.naming.event.InstancesChangeNotifier.onEvent(InstancesChangeNotifier.java:42) ~[nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.common.notify.DefaultPublisher.lambda$notifySubscriber$0(DefaultPublisher.java:199) ~[nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.common.notify.DefaultPublisher.notifySubscriber(DefaultPublisher.java:206) [nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.common.notify.DefaultPublisher.receiveEvent(DefaultPublisher.java:190) [nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.common.notify.DefaultPublisher.openEventHandler(DefaultPublisher.java:112) [nacos-client-2.2.1.jar!/:?] at com.alibaba.nacos.common.notify.DefaultPublisher.run(DefaultPublisher.java:95) [nacos-client-2.2.1.jar!/:?]

Anything else

No response

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

Code of Conduct

chickenlj commented 6 months ago

Please check if there are metadata cache file under ~/.dubbo/.metadata