XnLemon commented on code in PR #3395:
URL: https://github.com/apache/dubbo-go/pull/3395#discussion_r3400068871
##########
metadata/client.go:
##########
@@ -70,23 +77,27 @@ func GetMetadataFromRpc(revision string, instance
registry.ServiceInstance) (*in
return remoteService.getMetadataInfo(context.Background(), revision)
}
+// remoteMetadataService is the internal interface for fetching MetadataInfo
via RPC.
+// The context parameter is accepted for future cancellation support but is
not yet propagated.
type remoteMetadataService interface {
- getMetadataInfo(context context.Context, revision string)
(*info.MetadataInfo, error)
+ getMetadataInfo(_ context.Context, revision string)
(*info.MetadataInfo, error)
}
type triMetadataServiceV2 struct {
invoker base.Invoker
}
-func (m *triMetadataServiceV2) getMetadataInfo(ctx context.Context, revision
string) (*info.MetadataInfo, error) {
+// getMetadataInfo fetches metadata via RPC using the Triple v2 protocol.
+// TODO(context-propagation): ctx is not yet forwarded to the invoker;
cancellation is not respected.
+func (m *triMetadataServiceV2) getMetadataInfo(_ context.Context, revision
string) (*info.MetadataInfo, error) {
const methodName = "GetMetadataInfo"
req := &tripleapi.MetadataRequest{Revision: revision}
metadataInfo := &tripleapi.MetadataInfoV2{}
inv, _ := generateInvocation(m.invoker.GetURL(), methodName, req,
metadataInfo, constant.CallUnary)
res := m.invoker.Invoke(context.Background(), inv)
if res.Error() != nil {
- logger.Errorf("[Metadata] could not get the metadata info from
remote provider, err=%v", res.Error())
- return nil, res.Error()
+ logger.Errorf("[Metadata-RPC] could not get the metadata info
from remote provider, err=%v", res.Error())
Review Comment:
好的
--
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]