Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: grpc.DialContext and grpc.WithBlock functions are deprecated #1012

Open
jraddaoui opened this issue Aug 27, 2024 · 0 comments
Open

Comments

@jraddaoui
Copy link
Collaborator

Is your request related to a problem? Please describe.

After upgrading google.golang.org/grpc from v1.63.2 to v1.65.0, a couple of deprecation warnings are being reported by golangci-lint:

internal/telemetry/traces.go:36:15: SA1019: grpc.DialContext is deprecated: use NewClient instead.  Will be supported throughout 1.x. (staticcheck)
	conn, err := grpc.DialContext(
	             ^
internal/telemetry/traces.go:40:3: SA1019: grpc.WithBlock is deprecated: this DialOption is not supported by NewClient. Will be supported throughout 1.x. (staticcheck)
		grpc.WithBlock(),
		^
internal/a3m/client.go:21:15: SA1019: grpc.DialContext is deprecated: use NewClient instead.  Will be supported throughout 1.x. (staticcheck)
	conn, err := grpc.DialContext(
	             ^

More info about the deprecation:

Describe the solution you'd like

For now, after the changes in #1011, we are ignoring those warnings. But we should consider using grpc.NewClient, which raises a couple of questions:

  • Should we check the client connection after creation? Reading the links above it seems unnecessary.
  • Should we close the client connection after all? I looks like we should.

Describe alternatives you've considered

Keep ignoring the warning until we upgrade google.golang.org/grpc to version 2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant