-
Notifications
You must be signed in to change notification settings - Fork 244
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 API Server port detection issue by making sure the same local address is used for listening and checking if the port is available #7041
Conversation
This ensures the same local address is used for listening and checking if a given port is free. Otherwise, `net.listen("tcp", ":$port")` would listen on `0.0.0.0:$port`, and, on some operating systems like Windows 11, `127.0.0.1:$port` is surprisingly considered as free (see output below). This, as a consequence, made it impossible to run multiple Dev Sessions on Windows. ``` PS C:\Users\asoro> netstat -aon | grep 2000 TCP 0.0.0.0:20000 0.0.0.0:0 LISTENING 11044 TCP 127.0.0.1:20001 0.0.0.0:0 LISTENING 11044 TCP [::]:20000 [::]:0 LISTENING 11044 TCP [::1]:20000 [::1]:53656 ESTABLISHED 11044 TCP [::1]:53656 [::1]:20000 ESTABLISHED 9984 ``` Using the same local address for listening and checking if the port is free would be safer. If we decide to support passing a custom address, we would use that address instead.
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix
Test failing on OpenShift for similar reasons as in #7044 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Failure to be addressed in #7044 /override OpenShift-Integration-tests/OpenShift-Integration-tests |
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Unrelated flaky E2E test. Reported in #6582 /override windows-integration-test/Windows-test |
@rm3l: Overrode contexts on behalf of rm3l: windows-integration-test/Windows-test In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this:
/kind bug
/area dev
What does this PR do / why we need it:
This ensures the same local address is used for listening and checking if a given port is free.
Otherwise,
net.listen("tcp", ":$port")
would listen on0.0.0.0:$port
(see output below),and, on some operating systems like Windows 11,
127.0.0.1:$port
is surprisingly considered free.This, as a consequence, made it impossible to run multiple Dev Sessions on Windows.
Using the same local address for listening and checking if the port is free would be safer.
If we decide to support passing a custom address to the API Server, we will use that address instead.
Which issue(s) this PR fixes:
Fixes #6721
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
It should be possible to start several Dev Sessions on Windows. See #6721 (comment)