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

fix: Check that a port truly is free before using it #11085

Merged
merged 5 commits into from
Oct 12, 2022

Conversation

Artur-
Copy link
Contributor

@Artur- Artur- commented Oct 5, 2022

Description

If for instance 0.0.0.0:12345 is bound then running chromedriver with '--port=12345 --allowed-ips=1.2.3.4' fails with address already in use. If ::1 port 1234 is in used, chromedriver with '--port=12345' fails

Motivation and Context

Chromedriver fails to start in many cases with [SEVERE]: bind() failed: Address already in use (48)

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.

If 0.0.0.0 port 12345 is in use, then 'chromedriver --port=12345 --allowed-ips=1.2.3.4' fails with address already in use.
If ::1 port 12345 is in use, then 'chromedriver --port=12345' fails.
@CLAassistant
Copy link

CLAassistant commented Oct 5, 2022

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2022

Codecov Report

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

Coverage data is based on head (214ccb7) compared to base (6479063).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #11085   +/-   ##
=======================================
  Coverage   55.49%   55.49%           
=======================================
  Files          82       82           
  Lines        5503     5503           
  Branches      278      278           
=======================================
  Hits         3054     3054           
  Misses       2171     2171           
  Partials      278      278           

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.

@sonarcloud
Copy link

sonarcloud bot commented Oct 12, 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 1 Code Smell

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, @Artur-!

@diemol diemol merged commit 3beefec into SeleniumHQ:trunk Oct 12, 2022
@diemol
Copy link
Member

diemol commented Oct 24, 2022

@Artur- I am reverting the isFree("::1", port), this is breaking in Linux and some macOS machines.

@Artur-
Copy link
Contributor Author

Artur- commented Oct 25, 2022

Is the problem that the machines do not have ipv6 support on or something else?

@diemol
Copy link
Member

diemol commented Oct 25, 2022

I would say yes, however I didn't have enough time to check it

@Artur-
Copy link
Contributor Author

Artur- commented Oct 25, 2022

Ok, I assumed } catch (Exception e) { would have caught that

@Artur-
Copy link
Contributor Author

Artur- commented Oct 25, 2022

Ah, but that returns false. So then every port will be in use and nothing free..

@diemol
Copy link
Member

diemol commented Oct 25, 2022

Ah, but that returns false. So then every port will be in use and nothing free..

Exactly, that is the issue, so we do not know if ipv6 is available or the port being busy.

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.

4 participants