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

[java] pick random port outside of well-known ranges of ephemeral ports #10990

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

h-arlt
Copy link
Contributor

@h-arlt h-arlt commented Aug 31, 2022

Description

Let port prober choose from a safe range of ephemeral ports that explicitly exclude the well-known range of ephemeral ports used by the OS for port allocation (as was done in Selenium v3) while keeping fallback to IANA port range in case range of ephemeral ports is too low (less than 5k).

Motivation and Context

Instead of choosing a random port within the well-known ranges of ephemeral ports, those ranges should be excluded in order to minimize probability of collisions with port allocations performed by OS.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Let port prober choose from a safe range of ephemeral ports that
explicitly exclude the well-known range of ephemeral ports used by the
OS for port allocation as was done in Selenium v3.

Keep fallback to IANA port range in case range of ephemeral ports
is too low (less than 5k).

Fixes SeleniumHQ#10974
@CLAassistant
Copy link

CLAassistant commented Aug 31, 2022

CLA assistant check
All committers have signed the CLA.

@h-arlt h-arlt marked this pull request as ready for review August 31, 2022 09:31
@h-arlt
Copy link
Contributor Author

h-arlt commented Aug 31, 2022

I followed the steps described in README to build and test Selenium Java but had to abort the build process as it eats all of my free disk space. I would really appreciate if someone else could take over that part.

@symonk symonk added the C-java label Aug 31, 2022
@symonk symonk changed the title pick random port outside of well-known ranges of ephemeral ports [java] pick random port outside of well-known ranges of ephemeral ports Aug 31, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Base: 52.31% // Head: 52.31% // No change to project coverage 👍

Coverage data is based on head (96de571) compared to base (07d52d4).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #10990   +/-   ##
=======================================
  Coverage   52.31%   52.31%           
=======================================
  Files          82       82           
  Lines        5503     5503           
  Branches      198      198           
=======================================
  Hits         2879     2879           
  Misses       2426     2426           
  Partials      198      198           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pujagani
Copy link
Contributor

Related to #10974

@pujagani
Copy link
Contributor

I have gone through the changes and it looks fine on the surface. However, Simon and Diego will have a better idea about this area. I have requested them to help review it.

@nocive
Copy link

nocive commented Oct 4, 2022

bump

@h-arlt
Copy link
Contributor Author

h-arlt commented Oct 5, 2022

Hi guys. Any news on this?
Just let me know if there is anything missing from my side. Thx!

@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @h-arlt!

@diemol diemol merged commit 2eb3a0e into SeleniumHQ:trunk Oct 13, 2022
@h-arlt h-arlt deleted the 10974_port-collision-on-linux branch October 14, 2022 06:56
@h-arlt
Copy link
Contributor Author

h-arlt commented Oct 14, 2022

🥳 Thanks for merging, @diemol !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants