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/28 11:26:12 UTC

[GitHub] [dubbo] zrlw commented on a change in pull request #9284: [3.0] save current rpc service context to url at the beginning of invocation to support LazyConnectExchangeClient and avoid NPE

zrlw commented on a change in pull request #9284:
URL: https://github.com/apache/dubbo/pull/9284#discussion_r757881667



##########
File path: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java
##########
@@ -182,6 +182,9 @@ public Result invoke(Invocation inv) throws RpcException {
     }
 
     private void prepareInvocation(RpcInvocation inv) {
+        // fix #9283: set service context of InstanceAddressURL before other preparation.
+        url.setContext(RpcContext.getServiceContext());

Review comment:
       那么是不是LazyConnectExchangeClient这个功能要排除InstanceAddressURL类型的URL了,多个上下文复用这种类型的URL,那么在rpc之后根本没有办法从这种类型的URL获取path、protocol()和parameters了。




-- 
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