Skip to content

Commit

Permalink
Upgrade gRPC to 1.38.x (jaegertracing#3056)
Browse files Browse the repository at this point in the history
* Upgrade gRPC to 1.38.x

Signed-off-by: Pavol Loffay <[email protected]>

* ui

Signed-off-by: Pavol Loffay <[email protected]>

* Fix thrift

Signed-off-by: Pavol Loffay <[email protected]>

* fix ugly thrift

Signed-off-by: Pavol Loffay <[email protected]>

* Add test

Signed-off-by: Pavol Loffay <[email protected]>

* Add wire compatibility test

Signed-off-by: Pavol Loffay <[email protected]>

* import fmt

Signed-off-by: Pavol Loffay <[email protected]>

* more tests

Signed-off-by: Pavol Loffay <[email protected]>

* Bump mux

Signed-off-by: Pavol Loffay <[email protected]>

* Add benchmark

Signed-off-by: Pavol Loffay <[email protected]>

* move package

Signed-off-by: Pavol Loffay <[email protected]>

* lint

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Jun 8, 2021
1 parent aefe42d commit a2b2e4b
Show file tree
Hide file tree
Showing 25 changed files with 3,179 additions and 2,808 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SWAGGER_IMAGE=quay.io/goswagger/swagger:v$(SWAGGER_VER)
SWAGGER=docker run --rm -it -u ${shell id -u} -v "${PWD}:/go/src/" -w /go/src/ $(SWAGGER_IMAGE)
SWAGGER_GEN_DIR=swagger-gen

JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.2.0
JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.3.0

COLOR_PASS=$(shell printf "\033[32mPASS\033[0m")
COLOR_FAIL=$(shell printf "\033[31mFAIL\033[0m")
Expand Down Expand Up @@ -172,6 +172,8 @@ lint-staticcheck:
time staticcheck ./... \
| grep -v \
-e model/model.pb.go \
-e proto-gen \
-e _test.pb.go \
-e thrift-gen/ \
-e swagger-gen/ \
>> $(LINT_LOG) || true
Expand Down
13 changes: 12 additions & 1 deletion cmd/agent/app/reporter/grpc/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"time"

grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
"github.com/uber/jaeger-lib/metrics"
Expand Down Expand Up @@ -80,7 +82,7 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact
return nil, errors.New("at least one collector hostPort address is required when resolver is not available")
}
if len(b.CollectorHostPorts) > 1 {
r, _ := manual.GenerateAndRegisterManualResolver()
r, _ := generateAndRegisterManualResolver()
var resolvedAddrs []resolver.Address
for _, addr := range b.CollectorHostPorts {
resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: addr})
Expand Down Expand Up @@ -123,3 +125,12 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact

return conn, nil
}

// generateAndRegisterManualResolver was removed from grpc.
// Copied here to keep behavior the same.
func generateAndRegisterManualResolver() (*manual.Resolver, func()) {
scheme := strconv.FormatInt(time.Now().UnixNano(), 36)
r := manual.NewBuilderWithScheme(scheme)
resolver.Register(r)
return r, func() { resolver.UnregisterForTesting(scheme) }
}
2 changes: 1 addition & 1 deletion cmd/collector/app/zipkin/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/go-openapi/loads"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/golang/protobuf/proto"
"github.com/gogo/protobuf/proto"
"github.com/gorilla/mux"

"github.com/jaegertracing/jaeger/cmd/collector/app/handler"
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/zipkin/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"testing"
"time"

"github.com/golang/protobuf/proto"
"github.com/gogo/protobuf/proto"
"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
1 change: 1 addition & 0 deletions cmd/query/app/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/jaegertracing/jaeger/cmd/query/app/querysvc"
"github.com/jaegertracing/jaeger/model"
_ "github.com/jaegertracing/jaeger/pkg/gogocodec" //force gogo codec registration
"github.com/jaegertracing/jaeger/proto-gen/api_v2"
"github.com/jaegertracing/jaeger/storage/spanstore"
)
Expand Down
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ require (
github.com/gogo/googleapis v1.4.1
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.4.3 // indirect
github.com/golang/protobuf v1.3.5
github.com/golang/protobuf v1.5.2
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/go-hclog v0.16.1
github.com/hashicorp/go-plugin v1.4.2
Expand Down Expand Up @@ -65,10 +65,12 @@ require (
go.uber.org/atomic v1.7.0
go.uber.org/automaxprocs v1.4.0
go.uber.org/zap v1.17.0
golang.org/x/lint v0.0.0-20200302205851-738671d3881b
golang.org/x/net v0.0.0-20210510120150-4163338589ed
golang.org/x/sys v0.0.0-20210423082822-04245dca01da
google.golang.org/grpc v1.29.1
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/sys v0.0.0-20210603125802-9665404d3644
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.38.0
google.golang.org/protobuf v1.26.0
gopkg.in/ini.v1 v1.52.0 // indirect
gopkg.in/yaml.v2 v2.4.0
honnef.co/go/tools v0.2.0
Expand Down
80 changes: 65 additions & 15 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion model/ids_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/gogo/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
Loading

0 comments on commit a2b2e4b

Please sign in to comment.