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: start provider with random port #476

Merged
merged 15 commits into from
Apr 28, 2020

Conversation

zouyx
Copy link
Member

@zouyx zouyx commented Apr 13, 2020

What this PR does:

  • if want to use random port in provider then don't provide port in server config file , like
protocols:
  "dubbo":
    name: "dubbo"
#    port: 20000

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


config/service_config.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Apr 14, 2020

Codecov Report

Merging #476 into develop will increase coverage by 0.12%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #476      +/-   ##
===========================================
+ Coverage    66.39%   66.51%   +0.12%     
===========================================
  Files          184      184              
  Lines         9700     9718      +18     
===========================================
+ Hits          6440     6464      +24     
+ Misses        2624     2616       -8     
- Partials       636      638       +2     
Impacted Files Coverage Δ
config/service_config.go 71.31% <75.00%> (+0.14%) ⬆️
cluster/cluster_impl/failback_cluster_invoker.go 78.49% <0.00%> (-2.16%) ⬇️
remoting/kubernetes/listener.go 56.07% <0.00%> (ø)
protocol/dubbo/client.go 69.09% <0.00%> (+1.21%) ⬆️
protocol/dubbo/readwriter.go 70.73% <0.00%> (+2.43%) ⬆️
protocol/dubbo/codec.go 77.50% <0.00%> (+5.00%) ⬆️
cluster/cluster_impl/base_cluster_invoker.go 72.46% <0.00%> (+10.14%) ⬆️

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 bc6cc20...fcaa44a. Read the comment docs.

config/service_config.go Outdated Show resolved Hide resolved
config/service_config.go Outdated Show resolved Hide resolved
config/service_config.go Outdated Show resolved Hide resolved
@zouyx zouyx changed the title Ftr: start provider with random port [WIP]Ftr: start provider with random port Apr 25, 2020
@AlexStocks
Copy link
Contributor

there are three things left to do. Number 1, wait for the latest dubbogo/getty pr. Number 2, @zouyx pls change your example in ur first comment to let followers know how to use this feature clearly.

for examples:

# server.yml
protocols:
  "dubbo":
    name: "dubbo"
#    port: 20000

or

# server.yml
protocols:
  "dubbo":
    name: "dubbo"
    ip: "192.168.0.1"

or other examples.

Number 3, if the server or the server examples of dubbo-samples do not support set ip, pls add or improve it if you think the binding-ip is a important feature.

@zouyx zouyx changed the title [WIP]Ftr: start provider with random port Ftr: start provider with random port Apr 27, 2020
@zouyx
Copy link
Member Author

zouyx commented Apr 27, 2020

I think this is the best implement in random port , because it compatibility with jsonrpc ,grpc and rest, that three protocols are not use getty to start server .

rest:

jsonrpc:

func (s *Server) Start(url common.URL) {

grpc:

if err = server.Serve(lis); err != nil {

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

config/service_config.go Show resolved Hide resolved
config/service_config_test.go Show resolved Hide resolved
@zouyx zouyx requested a review from hxmhlt April 28, 2020 05:26
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

@AlexStocks
Copy link
Contributor

LGTM

@fangyincheng fangyincheng merged commit 24e7205 into apache:develop Apr 28, 2020
@zouyx zouyx deleted the feature/randomPort branch May 1, 2020 09:45
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.

None yet

7 participants