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

Ftr : add UnRegister and UnSubscribe for zookeeper Registry #510

Merged
merged 21 commits into from
May 20, 2020

Conversation

zouyx
Copy link
Member

@zouyx zouyx commented May 10, 2020

What this PR does:

  • add UnRegister and UnSubscribe for Registry

Which issue(s) this PR fixes:

Fixes #489

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@zouyx zouyx changed the title [WIP] Ftr : add UnRegister and UnSubscribe for Registry [WIP] Ftr : add UnRegister and UnSubscribe for zookeeper Registry May 10, 2020
@AlexStocks AlexStocks requested review from hxmhlt and flycash and removed request for hxmhlt May 11, 2020 03:22
@zouyx zouyx marked this pull request as draft May 11, 2020 06:56
@codecov-io
Copy link

codecov-io commented May 11, 2020

Codecov Report

Merging #510 into feature/dubbo-2.7.5 will increase coverage by 0.19%.
The diff coverage is 69.54%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feature/dubbo-2.7.5     #510      +/-   ##
=======================================================
+ Coverage                66.38%   66.57%   +0.19%     
=======================================================
  Files                      184      199      +15     
  Lines                     9717    10275     +558     
=======================================================
+ Hits                      6451     6841     +390     
- Misses                    2626     2776     +150     
- Partials                   640      658      +18     
Impacted Files Coverage Δ
common/extension/event_dispatcher.go 0.00% <0.00%> (ø)
common/extension/metadata_report_factory.go 0.00% <0.00%> (ø)
...ommon/observer/dispatcher/mock_event_dispatcher.go 0.00% <0.00%> (ø)
common/rpc_service.go 85.18% <0.00%> (-1.07%) ⬇️
config/base_config.go 64.14% <ø> (ø)
registry/etcdv3/registry.go 69.01% <0.00%> (-4.13%) ⬇️
registry/kubernetes/registry.go 67.88% <0.00%> (-3.27%) ⬇️
registry/nacos/registry.go 55.31% <0.00%> (-3.11%) ⬇️
remoting/zookeeper/listener.go 51.09% <0.00%> (-0.29%) ⬇️
common/observer/event.go 16.66% <16.66%> (ø)
... and 38 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 24e7205...ab046ef. Read the comment docs.

@zouyx zouyx marked this pull request as ready for review May 13, 2020 02:25
@zouyx zouyx changed the title [WIP] Ftr : add UnRegister and UnSubscribe for zookeeper Registry Ftr : add UnRegister and UnSubscribe for zookeeper Registry May 16, 2020
@zouyx zouyx assigned zouyx, hxmhlt and pantianying and unassigned zouyx May 16, 2020
@pantianying
Copy link
Member

suggested to run off the scene of ZK disconnection at last

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

err := reg.Register(url)
assert.NoError(t, err)

if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

why add err != nil? by assert.NoError(t, err), when err != nil, the ut will fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

This block is the same to Test_subsribe ,or you mean Test_subscribe is incorrect too ?

Copy link
Contributor

Choose a reason for hiding this comment

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

it is not necessary. i think it is better to delete them. or other resons?

Copy link
Member Author

Choose a reason for hiding this comment

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

@hxmhlt can you remember the reason? If not , can i delete it?

@cch123
Copy link
Contributor

cch123 commented May 18, 2020

LGTM

@AlexStocks
Copy link
Contributor

LGTM

have u tested this pr?

Copy link
Member

@pantianying pantianying left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2020

Codecov Report

Merging #510 into feature/dubbo-2.7.5 will increase coverage by 0.37%.
The diff coverage is 69.78%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feature/dubbo-2.7.5     #510      +/-   ##
=======================================================
+ Coverage                66.38%   66.76%   +0.37%     
=======================================================
  Files                      184      199      +15     
  Lines                     9717    10272     +555     
=======================================================
+ Hits                      6451     6858     +407     
- Misses                    2626     2755     +129     
- Partials                   640      659      +19     
Impacted Files Coverage Δ
common/extension/event_dispatcher.go 0.00% <0.00%> (ø)
common/extension/metadata_report_factory.go 0.00% <0.00%> (ø)
...ommon/observer/dispatcher/mock_event_dispatcher.go 0.00% <0.00%> (ø)
common/rpc_service.go 85.18% <0.00%> (-1.07%) ⬇️
config/base_config.go 64.14% <ø> (ø)
registry/etcdv3/registry.go 69.01% <0.00%> (-4.13%) ⬇️
registry/kubernetes/registry.go 68.51% <0.00%> (-2.64%) ⬇️
registry/nacos/registry.go 55.31% <0.00%> (-3.11%) ⬇️
remoting/zookeeper/listener.go 51.09% <0.00%> (-0.29%) ⬇️
common/observer/event.go 16.66% <16.66%> (ø)
... and 39 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 24e7205...7e7db7b. Read the comment docs.

func (r *BaseRegistry) createPath(dubboPath string) error {
r.cltLock.Lock()
defer r.cltLock.Unlock()
return r.facadeBasedRegistry.CreatePath(dubboPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

have u got the reason of lock facadeBasedRegistry.CreatePath by r.cltLock.Lock()?

Copy link
Member Author

Choose a reason for hiding this comment

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

the source code as below, i just extract it.

r.cltLock.Lock()

r.cltLock.Lock()

r.cltLock.Lock()

@AlexStocks AlexStocks merged commit 9026120 into apache:feature/dubbo-2.7.5 May 20, 2020
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.

10 participants