common
common copied to clipboard
Broken grpc.WithBalancerName
After updating to google.golang.org/grpc v1.46.0
I cannot compile anymore with the following error:
../../../../pkg/mod/github.com/weaveworks/[email protected]/httpgrpc/server/server.go:137:8: undefined: grpc.WithBalancerName
It seems that the WithBalancerName
was actually removed in grpc after it was deprecated for some time https://github.com/grpc/grpc-go/pull/5232
The code in this repository that needs updating can be found here: https://github.com/weaveworks/common/blob/f83ccc76d8237acd9d0fa0c68b61298fbb2cb03d/httpgrpc/server/server.go#L137
Thanks for spotting this. Upgrades to gRPC are always a bit fraught.
That said, I think httpgrpc server.NewClient
can be deleted. It isn't used in Cortex or Mimir, or in the Grafana Labs closed-source relating to those projects, and I also well remember removing its usage from Weaveworks' closed source.
It might be a bit more polite to replace with:
const grpcServiceConfig = `{"loadBalancingPolicy":"round_robin"}`
grpc.WithDefaultServiceConfig(grpcServiceConfig),
I was able to workaround this by using another version of grpc: go get -d google.golang.org/[email protected]
. The packages I wanted to use with weaveworks/common
were able to work that that version of grpc
.
I was able to workaround this by using another version of grpc: go get -d google.golang.org/[email protected]. The packages I wanted to use with weaveworks/common were able to work that that version of grpc.
Lucky guy. I'm stuck on OpenTelemetry Go v1.6.3 as later versions require gRPC > v1.45.0 and another dependency relies on weaveworks/common
:/
Unfortunately only workaround seems to be to add a replace
to a fork that contains a fix.
Is your problem fixed by #240 ? Please comment there if you have tested it for forwards/backwards compatibility.
Yes, it is fixed by #240! I replaced it in my go.mod
with that branch. Unfortunately I have not tested it for forwards/backwards compatability as I only depend on this package because it is imported by grafana/loki
. I directly depend on a newer version of google.golang.org/grpc
.