-
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
odo dev port forward timeouts if app is not ready #5877
Comments
Thanks for reporting this issue, @vinny-sabatini ! As discussed with the team today, we'll look into this when working on #5867, where we should have a better approach handling such cases. Side note: Because we use the same Go library as |
So it seems we will have to double check if the port is really open, before to forward it, even if the program has been started. I think using a readiness probe could be a solution: using a readiness probe, the pod will be marked as Ready only when the port is open, and we could start the forwarding only when the pod is Ready, and stop it as soon as it is not ready anymore. |
Indeed, that would be a nice solution in this case. |
@rm3l Why is the status blocked on this? |
This will solve only the initial startup problem. The readiness probe is not going to help with this. I think that users would be ok if the My understanding is that the main issue here is that |
I don't understand why. The readiness probe will set the Pod as non-ready if the probe fails to get a response when the app is restarted, and
I agree this could be a more robust solution. Looking for this warning message and restarting the port forwarding if it happens could help:
|
The biggest issue with using a readiness probe will be that you can have only one. So we will have to come up with some "hack" to make one check test all ports. The simple "restart-if-failed" solution might solve all of the problems that there currently are. |
Just wanted to confirm that was the behavior/issue we were running into and the intermittent errors after the port-forwarding failure made it tricky to continue developing without restarting the session. |
/kind bug
What versions of software are you using?
Operating System:
MacOS
Output of
odo version
:How did you run odo exactly?
I started a new project using
odo init
. I used the Go starter project and added a sleep before starting the web server. I ran theodo dev
command, and when theodo
said it was running, I tried to access the endpoint before the duration of the sleep. I also tried to access the endpoint multiple times after the sleep.The intention of the sleep is to simulate if the container takes some time to initialize and reach a ready state, which could be handled by a readiness probe if it were running in Kubernetes. I originally experienced this behavior with a Java Spring Boot application that took about 10 seconds to reach a ready state.
Actual behavior
The first request returned immediately with an empty reply from server. After the duration of the sleep, some requests were successful, but others would occasionally timeout with a connection reset by peer.
Expected behavior
Any logs, error output, etc?
Here is the odo output, note the first error is from when the first request came through (before the sleep duration completed), the second error is from an intermittent error:
Here is the output from the failed curl request:
The text was updated successfully, but these errors were encountered: