Skip to content

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

@inf17101

Description

@inf17101

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions