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

Make everserver port selection random #10010

Merged

Conversation

frode-aarstad
Copy link
Contributor

@frode-aarstad frode-aarstad commented Feb 7, 2025

Issue
Resolves #9934

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@frode-aarstad frode-aarstad self-assigned this Feb 7, 2025
Copy link

codspeed-hq bot commented Feb 7, 2025

CodSpeed Performance Report

Merging #10010 will not alter performance

Comparing frode-aarstad:everserver-port-selection (a459d69) with main (9f5093a)

Summary

✅ 25 untouched benchmarks

@@ -273,7 +274,8 @@ def get_shared_data(


def _find_open_port(host, lower, upper) -> int:
for port in range(lower, upper):
for _ in range(5):
Copy link
Contributor

@DanSava DanSava Feb 7, 2025

Choose a reason for hiding this comment

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

Just 5 tries seems a low number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It tries 5 times to randomly find a port not in use in the range 5000 to 5800. Should be low probability of not finding one

@@ -273,7 +274,8 @@ def get_shared_data(


def _find_open_port(host, lower, upper) -> int:
for port in range(lower, upper):
for _ in range(5):
port = random.randint(lower, upper)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment just to have an idea why this was needed so that once we update further everserver we might undo it.

Copy link
Contributor

@DanSava DanSava left a comment

Choose a reason for hiding this comment

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

Looks ok but as you mentioned this will not completely solve the underlying issue.

@frode-aarstad
Copy link
Contributor Author

I will up the retry to 10 and add a comment

@frode-aarstad frode-aarstad force-pushed the everserver-port-selection branch from 46d8668 to 8d9ceba Compare February 7, 2025 13:16
@frode-aarstad frode-aarstad force-pushed the everserver-port-selection branch from 8d9ceba to a459d69 Compare February 7, 2025 13:19
@frode-aarstad frode-aarstad added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Feb 7, 2025
@frode-aarstad frode-aarstad merged commit 3982f5b into equinor:main Feb 7, 2025
26 checks passed
@frode-aarstad frode-aarstad deleted the everserver-port-selection branch February 7, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeout on bleeding
2 participants