XnLemon commented on code in PR #3579:
URL: https://github.com/apache/dubbo-go/pull/3579#discussion_r3687478661


##########
metadata/client.go:
##########
@@ -160,15 +170,17 @@ type remoteMetadataServiceV1 struct {
 }
 
 // getMetadataInfo fetches metadata via RPC using the dubbo:// protocol 
(Hessian2 serialization).
-// TODO(context-propagation): ctx is not yet forwarded to the invoker; 
cancellation is not respected.

Review Comment:
   这里的原实现虽然接收了 `context.Context` 参数,但在实际调用 `invoker` 时重新使用了 
`context.Background()`,导致取消信号、超时、deadline 和 context value 无法继续传递
   这里新增了 `GetMetadataFromRpcWithContext`,并将 `context` 逐层传递到 metadata v1/v2 的 
`getMetadataInfo`,最终通过 `invoker.Invoke(ctx, inv)` 发起调用。同时,`context` 也会保存到 
`RPCInvocation` 中,避免后续 attachment 或脚本路由处理时丢失
   并且已添加对应回归测试而且go vet和lint通过
   但是位于 `registry/servicediscovery/service_instances_changed_listener_impl.go` 
仍有两个旧调用方 `metadata.GetMetadataFromRpc(revision, instance)`存在 但是那边不在scope内
   大概情况就是这样 



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