rpc: minor improvements#74195
Conversation
tbg
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @knz and @rauchenstein)
pkg/rpc/context.go, line 1198 at r2 (raw file):
if err != nil && !grpcutil.IsClosedConnection(err) && !grpcutil.IsConnectionRejected(err) { log.Health.Errorf(masterCtx, "removing connection to %s due to error: %v", target, err)
Wait, this makes a difference? What am I missing? https://go.dev/play/p/wbpx20tXsAu
pkg/rpc/heartbeat_test.go, line 161 at r1 (raw file):
log.SetExitFunc(false, func(_ exit.Code) { if hasExited.Get() { t.Fatalf("multiple log.Fatal calls encountered")
t.Errorf? Or is this called from the main goroutine? If so a comment might be helpful.
Release note: None
Release note: None
knz
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rauchenstein and @tbg)
pkg/rpc/context.go, line 1198 at r2 (raw file):
Previously, tbg (Tobias Grieger) wrote…
Wait, this makes a difference? What am I missing? https://go.dev/play/p/wbpx20tXsAu
no it doesn't make a difference in this case because err is not nil
however, we've been pretty consistent throughout the code base recommending %v for errors instead of %s and I'm pushing it here now for consistency.
pkg/rpc/heartbeat_test.go, line 161 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
t.Errorf? Or is this called from the main goroutine? If so a comment might be helpful.
t.Errorf is right, good call. It happens to be called from the main goroutine but we shouldn't rely on it.
Added a comment to explain the purpose too.
|
TFYR! bors r=tbg |
|
Build failed (retrying...): |
|
Build succeeded: |
Epic: CRDB-11517
Prereq to #71243 / #74312.