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

[Merged by Bors] - Use random port for post service in supervised mode #5731

Closed
wants to merge 7 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Mar 18, 2024

Motivation

In supervised mode the node should just pick a random port for post service by default to ensure that the connection of the service actually uses a free port on the system.

This PR requires #5730 to be merged for a bug fix first.

Description

The default port for PostListener has been changed to 127.0.0.1:0 effectively assigning a random (free) port to be used by the node and the post service for their communication.

To make this happen some code had to be re-arranged such that after starting the grpc server for the PostListener the node passes the bound address to the Smesher GRPC service (so it can use start/stop smeshing) and then checks if it is in supervised mode or not.

Test Plan

  • existing tests pass

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat self-assigned this Mar 18, 2024
@fasmat fasmat marked this pull request as ready for review March 19, 2024 00:10
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 73.46939% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 80.0%. Comparing base (333c56a) to head (ce18462).

Files Patch % Lines
node/node.go 61.5% 5 Missing and 5 partials ⚠️
api/grpcserver/smesher_service.go 76.9% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #5731     +/-   ##
=========================================
- Coverage     80.1%   80.0%   -0.1%     
=========================================
  Files          279     279             
  Lines        29021   29032     +11     
=========================================
+ Hits         23246   23248      +2     
- Misses        4179    4186      +7     
- Partials      1596    1598      +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fasmat
Copy link
Member Author

fasmat commented Mar 19, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Mar 19, 2024
@spacemesh-bors
Copy link

try

Build failed:

@fasmat
Copy link
Member Author

fasmat commented Mar 19, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Mar 19, 2024
@spacemesh-bors
Copy link

try

Build failed:

@spacemesh-bors spacemesh-bors bot changed the base branch from fix-signer-file-not-set-on-generate to develop March 19, 2024 10:17
@fasmat fasmat force-pushed the random-port-supervised-post-service branch from 24ffcca to ce18462 Compare March 19, 2024 10:30
@fasmat
Copy link
Member Author

fasmat commented Mar 19, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Mar 19, 2024
## Motivation

In supervised mode the node should just pick a random port for post service by default to ensure that the connection of the service actually uses a free port on the system.

This PR requires #5730 to be merged for a bug fix first.
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Use random port for post service in supervised mode [Merged by Bors] - Use random port for post service in supervised mode Mar 19, 2024
@spacemesh-bors spacemesh-bors bot closed this Mar 19, 2024
@spacemesh-bors spacemesh-bors bot deleted the random-port-supervised-post-service branch March 19, 2024 11:24
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.

2 participants