yangpixi opened a new issue, #3196: URL: https://github.com/apache/dubbo-go/issues/3196
### ✅ 验证清单 - [x] 🔍 我已经搜索过 [现有 Issues](https://github.com/apache/dubbo-go/issues),确信这不是重复问题 ### 🚀 Go 版本 1.24.0 ### 📦 Dubbo-go 版本 v3.3.1 ### 🖥️ 服务端配置 dubbo-go, v3.3.1 ### 💻 客户端配置 dubbo-go, v3.3.1 ### 🌐 协议配置 dubbo ### 📋 注册中心配置 Nacos v2.3.1 ### 💾 操作系统 🍎 macOS ### 📝 Bug 描述 具体现象: 使用应用级泛化调用时,client通过context设置的attachment(包括dubbo.tag以及dubbo.force.tag)不会注入到invocation里,后续对provider的filter因此失效,tag router即无法使用。同时provider设置的tag无法解析,导致获取到的invoker均不附带dubbo.tag 影响范围: tag router无法正常使用 ### 🔄 重现步骤 go-client请求代码: ``` ctxWithTag := context.WithValue(context.Background(), constant.AttachmentKey, map[string]any{constant.Tagkey: "testTag", constant.ForceUseTag: "false"}) call := func(methodName string, params []interface{}) (interface{}, error) { var result interface{} err := conn.CallUnary( ctxWithTag, params, &result, methodName, ) return result, err } ``` go-server设置代码: ``` serviceOpts := []server.ServiceOption{ server.WithInterface("org.apache.dubbo.samples.UserProvider"), server.WithVersion("1.0.0"), server.WithGroup("dubbo"), server.WithProtocolIDs([]string{"dubbo"}), server.WithTag("testTag"), } ``` ### ✅ 预期行为 当设置了dubbo.force.tag=true的时候若解析出来的invoker不具有dubbo.tag标签的时候泛化调用应该报错。 ### ❌ 实际行为 当invoker的dubbo.tag为空时,无论dubbo.force.tag为true还是false,泛化调用都会成功。 ### 💡 可能的解决方案 在client/client.go的generateInvocation方法里通过context获取attachment(修改protocol/invocation/rpcinvocation.go里的NewRPCInvocationWithOptions方法,添加一个attachments的参数,将context里的attachments传递进去)。 -- 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]
