Skip to content
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

How is podman's delete container procedure scheduled internally? #165

Open
inf17101 opened this issue Jul 31, 2023 · 0 comments
Open

How is podman's delete container procedure scheduled internally? #165

inf17101 opened this issue Jul 31, 2023 · 0 comments

Comments

@inf17101
Copy link

inf17101 commented Jul 31, 2023

Hello,

I have a question to following scenario:
Suppose I want to delete a container and then add it as new one with the podman-api. For our project, the operations should be synchronized that first the delete is done completely and then the create can start, otherwise the creation of the container can fail in some certain circumstances.

I am talking about this delete function in the documentation:
pub async fn delete(&self, opts: &opts::ContainerDeleteOpts) -> Result<()>

The expected workflow shall be like this:

  1. Delete container is requested by api call
  2. Create container is requested by api call
  3. Delete container is exectued
  4. Create container is executed => create is only done after deletion was actually executed completely

My question is now, is a delete immediately executed as task or does the podman api just return and give positive feedback that it is deleted, but the task is then put into a task queue and the container might be deleted later but not immediately?

If it would be put into a task queue and scheduled, then the real workflow can deviate from the expected workflow, resulting in the wrong order:

  1. Delete container is requested
  2. Create container is requested
  3. Create container is executed
  4. Delete container is executed only now

Step 3) is then failing.

If the task is not guaranteed to be executed immediately or like the requested order, how can be ensured that the order is like we want to have (expected workflow) when working with the podman-api?

Or is podman-api's remove function better as delete ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant