Description
Problem
If a container stops or exits during startup, most wait strategies will keep retrying to detect readiness, even though it will never succeed. But if the container has already stopped or exited, we know there's no reason retrying it. Instead, we should immediately throw an exception.
Solution
Ideally, we should also try to get the container logs and include them in the exception to help with debugging.
Benefit
This change would significantly improve the developer experience. Developers would get immediate feedback when something goes wrong.
It would also improve our CI process. For example, the Pulsar module test sometimes fails because a container exits during startup, but we don't know why. From running tests in GitHub Codespaces (Dev Containers), it looks like a memory issue, most likely the CI runner is running OOM (the issue has been fixed in the meantime).
Alternatives
-
Would you like to help contributing this enhancement?
Yes