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

channelz: use atomic instead of mutex #2218

Merged
merged 5 commits into from Aug 6, 2018
Merged

Conversation

lyuxuan
Copy link
Contributor

@lyuxuan lyuxuan commented Jul 13, 2018

No description provided.

@lyuxuan lyuxuan changed the title channelz: use atomic instead of mutext channelz: use atomic instead of mutex Jul 13, 2018
@menghanl menghanl self-assigned this Jul 19, 2018
@menghanl menghanl self-requested a review July 19, 2018 20:14
Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @lyuxuan)


clientconn.go, line 726 at r1 (raw file):

}

type channelzData struct {

Comment why this struct is necessary.

And move to another file since it's used by both client and server.


clientconn.go, line 730 at r1 (raw file):

	callsFailed         int64
	callsSucceeded      int64
	lastCallStartedTime int64

Comment what the format is and why.


clientconn.go, line 761 at r1 (raw file):

	channelzID int64 // channelz unique identification number
	czmu       sync.RWMutex

Remove this mutex


internal/transport/http2_client.go, line 117 at r1 (raw file):

}

type channelzData struct {

Move to another file

Copy link
Contributor

@menghanl menghanl 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: 2 of 6 files reviewed, 3 unresolved discussions (waiting on @menghanl and @lyuxuan)


rpc_util.go, line 761 at r2 (raw file):

	callsFailed         int64
	callsSucceeded      int64
	lastCallStartedTime int64

Comment the format and reason for this.


internal/transport/transport.go, line 752 at r2 (raw file):

	msgSent           int64
	msgRecv           int64
	lastMsgSent       int64

Comment the format and reason for this.
And add "Time" to the variable name so it's clear?

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 4 files at r2, 4 of 4 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lyuxuan lyuxuan merged commit f4da7ee into grpc:master Aug 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants