Skip to content

rpc: minor improvements#74195

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
knz:20211221-rpc
Dec 22, 2021
Merged

rpc: minor improvements#74195
craig[bot] merged 2 commits intocockroachdb:masterfrom
knz:20211221-rpc

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Dec 22, 2021

Epic: CRDB-11517
Prereq to #71243 / #74312.

@knz knz requested a review from tbg December 22, 2021 10:05
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: 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.

Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Dec 22, 2021

TFYR!

bors r=tbg

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 22, 2021

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 22, 2021

Build succeeded:

@craig craig bot merged commit 8661fdc into cockroachdb:master Dec 22, 2021
@knz knz deleted the 20211221-rpc branch December 22, 2021 14:32
@knz knz changed the title rpc: minor improvements rpc: add logging tags for rpc connect events Jan 4, 2022
@knz knz changed the title rpc: add logging tags for rpc connect events rpc: add logging for latency changes Jan 4, 2022
@knz knz changed the title rpc: add logging for latency changes rpc: minor improvements Jan 4, 2022
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

Successfully merging this pull request may close these issues.

3 participants