zrlw commented on issue #9283:
URL: https://github.com/apache/dubbo/issues/9283#issuecomment-971317621


   #9284 
修改了ReferenceCountExchangeClient的replaceWithLazyClient方法,在创建LazyConnectExchangeClient之前增加了RpcContext.getServiceContext().getConsumerUrl()非null判断,为null则直接返回以避免NPE。
   存在的不足:
   1. 不容易理解;
   2. 
不通用:严格意义上目前只有InstanceAddressURL类型的URL才会出现NPE,如果只对InstanceAddressURL类型的URL做上述判断,dubbo-rpc-dubbo要增加dubbo-registry-api依赖,然后ReferenceCountExchangeClient才能使用InstanceAddressURL类型进行判定。
   
   如果能直接获得当前ScopeModel的destroyed状态就好了,用destroy状态进行判定不仅容易理解,而且更支持URL类型扩展。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to