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

Rft : Optimize lock for zookeeper registry #578

Merged

Conversation

zouyx
Copy link
Member

@zouyx zouyx commented Jun 1, 2020

What this PR does:

  1. Optimize lock for zookeeper registry , change to RWLock.

Which issue(s) this PR fixes:

In zookeeper client , we can see too many write lock in it. Even read operation use write lock also.
So i think read operation use read lock will better in performance.

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2020

Codecov Report

Merging #578 into feature/dubbo-2.7.5 will increase coverage by 0.07%.
The diff coverage is 58.71%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feature/dubbo-2.7.5     #578      +/-   ##
=======================================================
+ Coverage                65.85%   65.93%   +0.07%     
=======================================================
  Files                      203      203              
  Lines                    10558    10549       -9     
=======================================================
+ Hits                      6953     6955       +2     
+ Misses                    2935     2921      -14     
- Partials                   670      673       +3     
Impacted Files Coverage Δ
registry/etcdv3/registry.go 69.01% <0.00%> (ø)
registry/kubernetes/registry.go 68.51% <0.00%> (ø)
registry/nacos/registry.go 55.31% <0.00%> (ø)
remoting/zookeeper/listener.go 51.09% <0.00%> (ø)
registry/consul/registry.go 42.10% <20.00%> (ø)
registry/zookeeper/registry.go 55.70% <58.97%> (ø)
remoting/zookeeper/client.go 67.22% <78.94%> (-1.36%) ⬇️
registry/zookeeper/listener.go 70.88% <88.88%> (+3.79%) ⬆️
registry/protocol/protocol.go 81.11% <90.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b364f31...9ae184f. Read the comment docs.

registry/zookeeper/registry.go Outdated Show resolved Hide resolved
registry/zookeeper/registry.go Outdated Show resolved Hide resolved
remoting/zookeeper/client.go Outdated Show resolved Hide resolved
remoting/zookeeper/client.go Outdated Show resolved Hide resolved
remoting/zookeeper/client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@hxmhlt hxmhlt left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

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

LGTM

@zouyx zouyx requested a review from AlexStocks June 2, 2020 15:28
@AlexStocks AlexStocks merged commit ff9eec7 into apache:feature/dubbo-2.7.5 Jun 2, 2020
@zouyx zouyx deleted the feature/addRegistryUnpub branch June 24, 2020 08:57
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.

6 participants