-
Notifications
You must be signed in to change notification settings - Fork 243
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
Wait until expected ports are opened in the container before starting port-forwarding #6701
Conversation
Skipping CI for Draft Pull Request. |
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
66a6719
to
c205ece
Compare
c205ece
to
0d71e0e
Compare
…are actually opened and in LISTEN state in specified containers
…ts to forward to are actually opened (or a timeout expires) This allows to display port-forwarding messages when the application is ready to accept requests. Otherwise, if the application takes time to listen on the port, and we try to reach the local forwarded port, port forwarding will be restarted. If we are using --random-ports, new random ports will be generated. Known issue: with the backo-go exponential backoff implementation, it seems hitting Ctrl-C does not stop waiting => we need to wait until the timeout is reached or the backoff is done.
…o forward to are actually opened (or a timeout expires) This allows to display port-forwarding messages when the application is ready to accept requests. Otherwise, if the application takes time to listen on the port, and we try to reach the local forwarded port, port forwarding will be restarted. If we are using --random-ports, new random ports will be generated. Known issue: with the backo-go exponential backoff implementation, it seems hitting Ctrl-C does not stop waiting => we need to wait until the timeout is reached or the backoff is done.
While iterating on the application, it might feel weird to stop the Dev Session immediately. Plus, a lot of integration tests are not passing because of source code not strictly matching the ports declared in the (too many) Devfiles.
…ing long to start
…hy app is not listening on the expected ports Co-authored-by: Parthvi Vala <pvala@redhat.com>
…e list to the users Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
…stand why app is not listening on the expected ports
…stand why app is not listening on the expected ports
87f7548
to
d800b94
Compare
Rebased to fix the issue with Doc tests (#6735). |
Flaky E2E test (#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. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Previous run was passing /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 feature
/area dev
What does this PR do / why we need it:
To fix some flaky behavior due to the app sometimes not being ready when sending out requests to the local forwarded ports, this PR leverages the port detector (introduced in #6620 to detect if container ports are bound on the container loopback interface) to wait until the container ports are actually opened before trying to start the port forwarding logic. See #6667 (comment)
For consistency, this is done on both Kubernetes and Podman platforms.
At the moment, this additional check will not prevent
odo dev
from starting, but a warning will just be displayed if the timeout (arbitrarily set to1m
) is reached and the port is not opened yet in the container, e.g.:Which issue(s) this PR fixes:
Fixes #6667
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
Run
odo dev
against any project on either Kubernetes or Podman. A newWaiting for the application to be ready
check will be displayed in the output and should timeout if the container port (declared in the Devfile) cannot be opened after 1 minute.