AlexStocks commented on code in PR #3580:
URL: https://github.com/apache/dubbo-go/pull/3580#discussion_r3687568749
##########
protocol/triple/reflection/serverreflection.go:
##########
@@ -166,7 +167,7 @@ func (s *ReflectionServer) ServerReflectionInfo(ctx
context.Context, stream rpb.
sentFileDescriptors := make(map[string]bool)
for {
in, err := stream.Recv()
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
Review Comment:
[P1] 覆盖 wrapped EOF 的实际完成路径
这个包当前没有任何测试,但真实调用链会产生 wrapped EOF:handler connection 的 Receive 错误经过
`wrapIfUncoded` 后成为实现 `Unwrap` 的 `*triple_protocol.Error`。使用 `Recv()` 返回
`fmt.Errorf("transport: %w", io.EOF)` 的 fake stream 做 Base/Head 区分时,Base
把它作为错误返回,当前 Head 才正常返回 nil。请增加回归测试,至少断言 wrapped EOF 正常结束,并断言 wrapped 非 EOF
仍原样传播;否则把 `errors.Is` 退回 `==` 时现有 CI 仍会全绿。
##########
otel/trace/exporter.go:
##########
@@ -74,7 +74,7 @@ func NewExporter(config *ExporterConfig, customFunc func()
(sdktrace.SpanExporte
exporter, err := customFunc()
if err != nil {
- err = fmt.Errorf("failed to create %s exporter: %v",
config.Exporter, err)
+ err = fmt.Errorf("failed to create %s exporter: %w",
config.Exporter, err)
Review Comment:
[P1] 补上错误链回归断言
现有 `TestNewExporter_CustomFuncError` 只检查错误字符串;我在 Base 的 `%v`
实现上单独运行它仍然通过,所以它无法防止本次修复回退。使用同一 cause 调用 `NewExporter` 的 Base/Head
探针中,`errors.Is(err, cause)` 在 Base 失败、当前 Head 通过。请在现有测试中保留 cause 并使用
`require.ErrorIs` 断言原始错误仍位于链上;需要覆盖 `errors.As` 时再加入自定义错误类型。
--
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]