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: Register service instance after provider config load #694

Merged
merged 14 commits into from
Aug 20, 2020

Conversation

Patrick0308
Copy link
Contributor

What this PR does:
Register service instance after provider config load

Which issue(s) this PR fixes:

Fixes #686

@zouyx zouyx added this to the 1.5.1 milestone Aug 8, 2020
@zouyx zouyx linked an issue Aug 9, 2020 that may be closed by this pull request
@zouyx zouyx added the enhancement New feature or request label Aug 9, 2020
config/config_loader.go Outdated Show resolved Hide resolved
config/config_loader.go Outdated Show resolved Hide resolved
@@ -146,6 +151,20 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc
return selectedInvoker
}

func (invoker *baseClusterInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
if invoker.interceptor != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

if invoker.interceptor == nil {
             return nil
}

invoker.interceptor.BeforeInvoker(ctx, invocation)
result := invoker.interceptor.DoInvoke(ctx, invocation)
invoker.interceptor.AfterInvoker(ctx, invocation)

return result

@zouyx zouyx changed the base branch from develop to 1.5.1 August 16, 2020 15:12
config/config_loader.go Outdated Show resolved Hide resolved
logger.Warn(err)
return nil
}
list, err := metaDataService.GetExportedURLs(constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE)
Copy link
Member

Choose a reason for hiding this comment

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

why not define a new variable with var selectedUrl common.URL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

selectedUrl is above

}
selectedUrl = url
// rest first
if url.Protocol == "rest" {
Copy link
Member

Choose a reason for hiding this comment

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

if break this loop when find rest protocol, is it a problem or bug in multi protocol ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dubbo in java use rest url first.

registry/protocol/protocol.go Show resolved Hide resolved
registry/service_discovery_factory.go Outdated Show resolved Hide resolved
@AlexStocks AlexStocks changed the title Register service instance after provider config load Fix:Register service instance after provider config load Aug 18, 2020
@AlexStocks AlexStocks changed the title Fix:Register service instance after provider config load Fix: Register service instance after provider config load Aug 18, 2020
config/config_loader.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #694 into 1.5.1 will increase coverage by 0.03%.
The diff coverage is 53.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##            1.5.1     #694      +/-   ##
==========================================
+ Coverage   63.89%   63.93%   +0.03%     
==========================================
  Files         239      239              
  Lines       12752    12795      +43     
==========================================
+ Hits         8148     8180      +32     
- Misses       3818     3822       +4     
- Partials      786      793       +7     
Impacted Files Coverage Δ
common/extension/metadata_service.go 0.00% <0.00%> (ø)
registry/protocol/protocol.go 78.48% <0.00%> (-2.31%) ⬇️
...try/servicediscovery/service_discovery_registry.go 11.91% <ø> (-3.34%) ⬇️
config/config_loader.go 57.27% <61.29%> (+1.57%) ⬆️
config_center/apollo/listener.go 82.60% <0.00%> (-17.40%) ⬇️
...tocol/rest/server/server_impl/go_restful_server.go 43.33% <0.00%> (-3.34%) ⬇️
config_center/nacos/listener.go 45.45% <0.00%> (-2.17%) ⬇️
config_center/apollo/impl.go 80.82% <0.00%> (-1.90%) ⬇️
protocol/dubbo/config.go 13.15% <0.00%> (ø)
config/consumer_config.go 56.25% <0.00%> (ø)
... and 5 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 e3dd46f...d58e4fa. Read the comment docs.

@pantianying pantianying merged commit 6657d27 into apache:1.5.1 Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

关于provider提前暴露ServiceInstance的解决方案
5 participants