AlexStocks commented on code in PR #1017:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1017#discussion_r3802804219
##########
pkg/client/dubbo/dubbo.go:
##########
@@ -311,15 +364,14 @@ func (dc *Client) preparePayload(req
*DubboOutboundRequest) ([]string, []hessian
vals[i] = arg
}
- finalValues, err := json.Marshal(vals)
- if err != nil {
- return nil, nil, nil, errors.Wrap(err, "marshal dubbo
arguments")
- }
-
- return types, vals, finalValues, nil
+ return types, vals, nil
}
-func mergeOutboundAttachments(ctx context.Context, outbound map[string]any)
map[string]any {
+func withAttachments(ctx context.Context, outbound map[string]any)
context.Context {
+ // fast path: no attachments, no tracing -> reuse the context as-is
+ if !tracingEnabled.Load() && len(outbound) == 0 &&
ctx.Value(constant.AttachmentKey) == nil {
Review Comment:
[P1] 这个 fast path 改变了公共 Dubbo Client.Call 的 trace-context 传播契约。Base 会始终执行全局
TextMapPropagator.Inject;当前 Head 在 tracingEnabled=false、没有业务 attachment
时直接返回,即使调用方已通过标准 OTel API 在 ctx 中放入有效 SpanContext,也不会生成 traceparent。判别探针设置
TraceContext propagator 和 remote SpanContext、保持 tracingEnabled=false 且
outbound=nil,返回 context 中完全没有 AttachmentKey;更不一致的是,增加任意无关业务 attachment 后同一
context 又会执行 Inject。请根据 propagator/span context 决定是否走快路径,不能把 Pixiu 内部 tracing
开关等同于“调用方没有需要传播的上下文”,并补外部 SpanContext + 空 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]