diff --git a/transport/grpc/resolver/discovery/builder.go b/transport/grpc/resolver/discovery/builder.go index 03ab16ecd..5ccdf6ef7 100644 --- a/transport/grpc/resolver/discovery/builder.go +++ b/transport/grpc/resolver/discovery/builder.go @@ -2,6 +2,7 @@ package discovery import ( "context" + "errors" "time" "github.com/go-kratos/kratos/v2/log" @@ -61,6 +62,7 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, opts res select { case <-done: case <-time.After(b.timeout): + err = errors.New("discovery create watcher overtime") } if err != nil { cancel()