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

Fix:deal the panic when invoker destroy #358

Merged
merged 7 commits into from
Feb 20, 2020

Conversation

pantianying
Copy link
Member

What this PR does:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@@ -47,6 +47,7 @@ var (

// DubboInvoker ...
Copy link
Contributor

Choose a reason for hiding this comment

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

add comment for this file, pls.

protocol/dubbo/dubbo_invoker.go Outdated Show resolved Hide resolved
protocol/dubbo/dubbo_invoker.go Outdated Show resolved Hide resolved
protocol/dubbo/dubbo_invoker.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Feb 15, 2020

Codecov Report

Merging #358 into develop will decrease coverage by 0.18%.
The diff coverage is 63.88%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #358      +/-   ##
===========================================
- Coverage    66.74%   66.55%   -0.19%     
===========================================
  Files          150      150              
  Lines         7936     7960      +24     
===========================================
+ Hits          5297     5298       +1     
- Misses        2137     2157      +20     
- Partials       502      505       +3
Impacted Files Coverage Δ
registry/directory/directory.go 82.58% <61.11%> (-0.99%) ⬇️
protocol/dubbo/dubbo_invoker.go 82.25% <66.66%> (-7.11%) ⬇️
config_center/nacos/facade.go 35.29% <0%> (-29.42%) ⬇️
cluster/cluster_impl/failback_cluster_invoker.go 78.49% <0%> (-2.16%) ⬇️
config_center/nacos/client.go 55.55% <0%> (-1.71%) ⬇️

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 d0d3ac1...873c7d9. Read the comment docs.

@pantianying pantianying changed the title add Rlock for dubbo Invoker Fix:deal the panic when invoker destroy Feb 15, 2020
@@ -110,11 +120,20 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati
// Destroy ...
func (di *DubboInvoker) Destroy() {
di.quitOnce.Do(func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

someone check this pls: Can this be async

Copy link
Contributor

Choose a reason for hiding this comment

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

the reqNum is used for judging if dubbo invoker is available ? Why not use isAvailable() func instead?

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 is used to check whether there are any stock requests in the invoker during destroy

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.

ignore this lgtm

@hxmhlt
Copy link
Contributor

hxmhlt commented Feb 16, 2020

@flycash I think maybe graceful down should consider the issue.

Copy link
Member

@flycash flycash 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

Choose a reason for hiding this comment

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

In extreme cases, infinite circulation possible? Should we control the upper limit?

Copy link
Member Author

@pantianying pantianying Feb 19, 2020

Choose a reason for hiding this comment

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

In extreme cases,there is always a request in the invoker that has not ended. If it is forcibly destroyed, it may cause a program panic. The severity of this result is greater than adding a loop.

Copy link
Member

@zouyx zouyx left a comment

Choose a reason for hiding this comment

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

LGTM

@flycash flycash merged commit 2d70b6f into apache:develop Feb 20, 2020
fangyincheng pushed a commit to fangyincheng/dubbo-go that referenced this pull request Feb 22, 2020
fangyincheng added a commit that referenced this pull request Feb 22, 2020
Merge pull request #358 from pantianying/addRlockForDubboInvoker
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.

8 participants