-
Notifications
You must be signed in to change notification settings - Fork 485
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
Fails to handle the service_healthy
condition of a depends_on
element
#866
Comments
Could be a duplicate, as the correct implementation of healthchecks is actually a 5-year-old issue: #23 |
I am hitting now the same bug: I have a container that is supposed to start when 4 previous containers are up and healthy, and instead it starts right away :-/ |
This feature is currently completely unimplemented in As for #23 it is about the implementation of I'll try get a PR for this if I had time working on this in the next week. |
@chaserhkj I have just run into this issue also. Are you working on a PR already? I can give it a look, but I am not familiar with the code base of podman-compose (meaning will take me a while), but I do not want to crash into your work. Update: After giving it a thought, I think I would update the code in the reference you provided, to return a list of a string or dictionaries, depending on the content of the file. Then, update this block so that the task first verifies that any healthcheck dependencies get fulfilled, before running the service. What do you think about this approach? |
I haven't got any chance to look into this further yet, please go ahead if you'd like to work on it. For your implementation plans, I would generally prefer to handle it the same way we handle normal dependencies here. But since podman does not support specifying healthcheck dependencies, I think we need to check it on our end whatsoever. We probably can call |
@chaserhkj I think this is not as simple as it seems. For what I have seen, the dependencies are actually managed in this block. As currently the dependencies are unconditional, this block works ok because it is just starting all of them in one go. What I have implemented is that, instead of a string, the _deps set contains ServiceDependency objects (hashable), and updated the corresponding location where _deps is used to refer to the name of the dependency, to prevent breaking current functionality. Update: I think I am looking at this the wrong way. Given that I have a set with the dependencies for which the service needs to be healthy, and they need to be all fulfilled for the main service to work, I can just concatenate the names and run podman wait once. This is the work in progress: #1078 |
My experience with dependencies is different, far from what I would call "works ok":
Is this specific to my setup? |
Describe the bug
podman-compose
fails to handle theservice_healthy
condition of adepends_on
element.To Reproduce
Steps to reproduce the behavior:
docker-compose.yml
filepodman-compose -f docker-compose.yml up -d
in the containing directoryExpected behavior
The container corresponding to the
dependent
service never starts since thebase
can never be healthy.Actual behavior
The container corresponding to the
dependent
service always starts.Output
Environment:
The text was updated successfully, but these errors were encountered: