-
Notifications
You must be signed in to change notification settings - Fork 4.5k
cleanup: replace dial with newclient #8196
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
cleanup: replace dial with newclient #8196
Conversation
Is this PR ready for review? |
yes, please |
6458128
to
d672f29
Compare
This reverts commit 79f6f35.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of unnecessary log message changes added in this PR. This makes it really hard to spot and review actual code changes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8196 +/- ##
==========================================
+ Coverage 82.06% 82.08% +0.02%
==========================================
Files 410 419 +9
Lines 40233 41988 +1755
==========================================
+ Hits 33018 34467 +1449
- Misses 5854 6046 +192
- Partials 1361 1475 +114
🚀 New features to boost your workflow:
|
I've addressed all the comments by reverting the changes related to log message updates and fixing the race condition by calling |
@arjan-bal I think Janardhan has reverted the unnecessary changes in the PR. It should be ready for review now. |
credentials/insecure/insecure.go
Outdated
@@ -30,7 +30,7 @@ import ( | |||
// NewCredentials returns a credentials which disables transport security. | |||
// | |||
// Note that using this credentials with per-RPC credentials which require | |||
// transport security is incompatible and will cause grpc.Dial() to fail. | |||
// transport security is incompatible and will cause grpc.NewClient() to fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this line needs to be updated to say that RPCs will fail and not grpc.NewClient()
.
dialoptions.go
Outdated
@@ -360,7 +360,7 @@ func WithReturnConnectionError() DialOption { | |||
// | |||
// Note that using this DialOption with per-RPC credentials (through | |||
// WithCredentialsBundle or WithPerRPCCredentials) which require transport | |||
// security is incompatible and will cause grpc.Dial() to fail. | |||
// security is incompatible and will cause grpc.NewClient() to fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this line needs to be updated to say that RPCs will fail and not grpc.NewClient()
.
stats/stats_test.go
Outdated
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) | ||
defer cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not create a context in this method, instead pass a context created in the original test function. This ensures the entire test has 10 secs to run. Presently if a test created channels in a for loop, the overall test timeout will get multiplied.
} | ||
te.cc.Connect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actionable: Normally I would suggest moving the Connect()
call to the calling functions because most of the callers wouldn't need it as they're making RPCs. In this case, there are 116 references, so we can keep the existing behaviour.
@arjan-bal The changes are done, it's ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one minor comment.
stats/stats_test.go
Outdated
if err != nil { | ||
te.t.Fatalf("Dial(%q) = %v", te.srvAddr, err) | ||
te.t.Fatalf("grpc.NewClient() failed(%q) = %v", te.srvAddr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(%q)
should be logged just after the function name as it's an argument.
test/end2end_test.go
Outdated
if err != nil { | ||
te.t.Fatalf("Dial(%q) = %v", scheme+te.srvAddr, err) | ||
te.t.Fatalf("grpc.NewClient() failed(%q) = %v", scheme+te.srvAddr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
te.t.Fatalf("grpc.NewClient() failed(%q) = %v", scheme+te.srvAddr, err) | |
te.t.Fatalf("grpc.NewClient(%q) failed: %v", scheme+te.srvAddr, err) |
addresses: #7049
RELEASE NOTES: None