remove depecrated code used from grpc library#9345
Merged
mangalaman93 merged 1 commit intomainfrom Mar 13, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes deprecated gRPC connection methods by replacing calls to grpc.Dial and grpc.DialContext with grpc.NewClient and updating related connection options.
- Replace grpc.WithBackoffMaxDelay with grpc.WithConnectParams using the new backoff configuration
- Update connection establishment calls in production and test files to use grpc.NewClient
- Ensure consistency across components that rely on gRPC connections
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| conn/pool.go | Updated connection creation and backoff configuration |
| dgraph/cmd/zero/zero_test.go | Replaced DialContext with NewClient in tests |
| graphql/e2e/common/common.go | Updated client creation in GraphQL bootstrap |
| ee/backup/run.go | Updated backup restore client connection creation |
| testutil/zero.go | Replaced grpc.Dial with grpc.NewClient in test utilities |
| dgraph/cmd/bulk/loader.go | Updated client creation for bulk loader backup operations |
| testutil/client.go | Updated client creation in test utilities |
| systest/backup/filesystem/backup_test.go | Replaced Dial with NewClient for filesystem backup tests |
| systest/export/export_test.go | Updated export test gRPC connection creation |
| systest/online-restore/online_restore_test.go | Updated multiple client connections for online restore tests |
| graphql/e2e/common/schema.go | Updated schema test client connection creation |
| dgraphtest/local_cluster.go | Replaced Dial with NewClient for local cluster client connections |
| systest/backup/minio/backup_test.go | Updated minio backup test gRPC connection creation |
| graphql/e2e/common/admin.go | Updated admin test client connection creation |
| dgraph/cmd/alpha/mutations_mode/mutations_mode_test.go | Updated mutations mode tests with NewClient instead of Dial |
| systest/backup/nfs-backup/backup_test.go | Updated NFS backup test client connection creation |
| graphql/e2e/common/query.go | Updated client creation for query tests |
| graphql/e2e/common/mutation.go | Updated mutation test client connection creation |
| graphql/e2e/common/error.go | Updated error test client connection creation |
| systest/backup/minio-large/backup_test.go | Updated minio-large backup test gRPC connection creation |
Comments suppressed due to low confidence (3)
conn/pool.go:179
- Verify that grpc.NewClient correctly handles connection timeouts and context cancellation, as its behavior may differ from grpc.DialContext.
conn, err := grpc.NewClient(addr, conOpts...)
dgraph/cmd/zero/zero_test.go:52
- Confirm that removing the grpc.WithBlock option does not cause race conditions in tests, as connection establishment might behave asynchronously with grpc.NewClient.
con, err := grpc.NewClient(testutil.SockAddrZero, dialOpts...)
dgraphtest/local_cluster.go:777
- Check that using grpc.NewClient in this health check context maintains the expected retry behavior and service configuration provided by grpc.WithDefaultServiceConfig.
conn, err := grpc.NewClient(url, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultServiceConfig(retryPolicy))
ghost
approved these changes
Mar 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.