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

[#779] feat: Grpc server support random port #820

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

xumanbu
Copy link
Contributor

@xumanbu xumanbu commented Apr 12, 2023

What changes were proposed in this pull request?

  1. grpc server port support random port
  2. grpc sever will retry binding with increased port num if configured port is already occupied

Why are the changes needed?

  1. improve robustness for server startup
  2. sync with netty server functionality

Fixs #779

Does this PR introduce any user-facing change?

Yes. rss.rpc.server.port could be set as zero.

How was this patch tested?

UT

@jerqi jerqi changed the title #779 grpc server support random port [#779] feat: Grpc server support random port Apr 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2023

Codecov Report

Merging #820 (00f606e) into master (cae7cd9) will increase coverage by 1.33%.
The diff coverage is 73.07%.

@@             Coverage Diff              @@
##             master     #820      +/-   ##
============================================
+ Coverage     57.63%   58.97%   +1.33%     
- Complexity     2058     2059       +1     
============================================
  Files           306      292      -14     
  Lines         14871    12909    -1962     
  Branches       1221     1224       +3     
============================================
- Hits           8571     7613     -958     
+ Misses         5808     4864     -944     
+ Partials        492      432      -60     
Impacted Files Coverage Δ
.../java/org/apache/uniffle/common/util/RssUtils.java 58.10% <0.00%> (-1.00%) ⬇️
...java/org/apache/uniffle/common/rpc/GrpcServer.java 80.26% <81.81%> (+3.45%) ⬆️
.../java/org/apache/uniffle/server/ShuffleServer.java 68.01% <100.00%> (-1.36%) ⬇️

... and 19 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @xumanbu

@xumanbu
Copy link
Contributor Author

xumanbu commented Apr 13, 2023

@leixm @advancedxy @zuston

@jerqi jerqi merged commit b0ae6db into apache:master Apr 13, 2023
this.port = conf.getInteger(RssBaseConf.RPC_SERVER_PORT);
long maxInboundMessageSize = conf.getLong(RssBaseConf.RPC_MESSAGE_MAX_SIZE);
this.rssConf = conf;
this.port = rssConf.getInteger(RssBaseConf.RPC_SERVER_PORT);
Copy link
Member

Choose a reason for hiding this comment

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

If using the random port, why reserve this var of port ? the listen port and port are unclear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree with u.in same test case have reuse RssBaseConf(i think it is a mistake), retain
this the port var just reserve the configuration value to avoid test failed.
ShuffleWithRssClientTest

@zuston
Copy link
Member

zuston commented Apr 13, 2023

Sorry for the late review.

@jerqi jerqi mentioned this pull request Apr 17, 2023
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

4 participants