You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/11/17 07:45:00 UTC

[GitHub] [dubbo] zrlw edited a comment on issue #9283: [3.0] scopeModel destroy时ReferenceCountExchangeClient的replaceWithLazyClient方法会出现NPE

zrlw edited a comment 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类型进行判定。(目前没有增加dubbo-registry-api依赖,所以URL具体类型无法判定,对所有URL都做上述处理未必合理)
   
   如果能直接获得当前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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org