Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nogolang authored Dec 20, 2024
2 parents 558b6bf + 5087366 commit 7708a7a
Show file tree
Hide file tree
Showing 32 changed files with 51 additions and 41 deletions.
2 changes: 1 addition & 1 deletion cmd/kratos/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// release is the current kratos tool version.
const release = "v2.8.2"
const release = "v2.8.3"
2 changes: 1 addition & 1 deletion cmd/protoc-gen-go-errors/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// release is the current protoc-gen-go-errors version.
const release = "v2.8.2"
const release = "v2.8.3"
2 changes: 1 addition & 1 deletion cmd/protoc-gen-go-http/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// release is the current protoc-gen-go-http version.
const release = "v2.8.2"
const release = "v2.8.3"
2 changes: 1 addition & 1 deletion contrib/config/apollo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/apolloconfig/agollo/v4 v4.3.1
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/consul/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/consul/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/hashicorp/consul/api v1.26.1
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/config/etcd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/etcd/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
go.etcd.io/etcd/client/v3 v3.5.11
google.golang.org/grpc v1.61.1
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/kubernetes/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/kubernetes/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
Expand Down
2 changes: 1 addition & 1 deletion contrib/config/nacos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/nacos/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/nacos-group/nacos-sdk-go v1.0.9
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/config/polaris/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/polaris/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/polarismesh/polaris-go v1.1.0
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/encoding/msgpack/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/encoding/msgpack/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/vmihailenco/msgpack/v5 v5.4.1
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/errortracker/sentry/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/getsentry/sentry-go v0.25.0
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/log/aliyun/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/aliyun/aliyun-log-go-sdk v0.1.75
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
google.golang.org/protobuf v1.33.0
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/log/fluent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/fluent/fluent-logger-golang v1.9.0
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
)

require (
Expand Down
2 changes: 1 addition & 1 deletion contrib/log/logrus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/logrus/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/sirupsen/logrus v1.8.1
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/log/tencent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/tencent/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2
google.golang.org/protobuf v1.33.0
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/log/zap/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/zap/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
go.uber.org/zap v1.26.0
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/log/zerolog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/zerolog/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/rs/zerolog v1.30.0
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/opensergo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/opensergo/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/opensergo/opensergo-go v0.0.0-20220331070310-e5b01fee4d1c
golang.org/x/net v0.30.0
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917
Expand Down
2 changes: 1 addition & 1 deletion contrib/polaris/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/go-kratos/aegis v0.2.0
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/google/uuid v1.4.0
github.com/polarismesh/polaris-go v1.3.0
google.golang.org/protobuf v1.33.0
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/consul/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/consul/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/hashicorp/consul/api v1.26.1
)

Expand Down
17 changes: 11 additions & 6 deletions contrib/registry/consul/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,17 @@ func (r *Registry) Watch(ctx context.Context, name string) (registry.Watcher, er
}

func (r *Registry) resolve(ctx context.Context, ss *serviceSet) error {
timeoutCtx, cancel := context.WithTimeout(ctx, r.timeout)
defer cancel()
listServices := r.cli.Service
if r.timeout > 0 {
listServices = func(ctx context.Context, service string, index uint64, passingOnly bool) ([]*registry.ServiceInstance, uint64, error) {
timeoutCtx, cancel := context.WithTimeout(ctx, r.timeout)
defer cancel()

services, idx, err := r.cli.Service(timeoutCtx, ss.serviceName, 0, true)
return r.cli.Service(timeoutCtx, service, index, passingOnly)
}
}

services, idx, err := listServices(ctx, ss.serviceName, 0, true)
if err != nil {
return err
}
Expand All @@ -240,9 +247,7 @@ func (r *Registry) resolve(ctx context.Context, ss *serviceSet) error {
for {
select {
case <-ticker.C:
timeoutCtx, cancel := context.WithTimeout(context.Background(), r.timeout)
tmpService, tmpIdx, err := r.cli.Service(timeoutCtx, ss.serviceName, idx, true)
cancel()
tmpService, tmpIdx, err := listServices(context.Background(), ss.serviceName, idx, true)
if err != nil {
time.Sleep(time.Second)
continue
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/discovery/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/discovery/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/go-resty/resty/v2 v2.11.0
github.com/pkg/errors v0.9.1
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/etcd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/etcd/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
go.etcd.io/etcd/client/v3 v3.5.11
google.golang.org/grpc v1.61.1
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/eureka/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/go-kratos/kratos/contrib/registry/eureka/v2

go 1.19

require github.com/go-kratos/kratos/v2 v2.8.2
require github.com/go-kratos/kratos/v2 v2.8.3

replace github.com/go-kratos/kratos/v2 => ../../../
2 changes: 1 addition & 1 deletion contrib/registry/kubernetes/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/kubernetes/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/json-iterator/go v1.1.12
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/nacos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/nacos/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/nacos-group/nacos-sdk-go v1.0.9
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/polaris/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/polaris/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/polarismesh/polaris-go v1.3.0
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/servicecomb/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/go-chassis/cari v0.6.0
github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/gofrs/uuid v4.2.0+incompatible
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/registry/zookeeper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/registry/zookeeper/v2
go 1.19

require (
github.com/go-kratos/kratos/v2 v2.8.2
github.com/go-kratos/kratos/v2 v2.8.3
github.com/go-zookeeper/zk v1.0.3
golang.org/x/sync v0.8.0
)
Expand Down
13 changes: 9 additions & 4 deletions transport/grpc/resolver/discovery/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolv
}()

var err error
select {
case <-done:
if b.timeout > 0 {
select {
case <-done:
err = watchRes.err
case <-time.After(b.timeout):
err = ErrWatcherCreateTimeout
}
} else {
<-done
err = watchRes.err
case <-time.After(b.timeout):
err = ErrWatcherCreateTimeout
}
if err != nil {
cancel()
Expand Down
4 changes: 2 additions & 2 deletions transport/grpc/resolver/discovery/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestBuilder_Build(t *testing.T) {
&mockConn{},
resolver.BuildOptions{},
)
if err == nil {
t.Errorf("expected error, got %v", err)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kratos

// Release is the current kratos version.
const Release = "v2.8.2"
const Release = "v2.8.3"

0 comments on commit 7708a7a

Please sign in to comment.