Skip to content

fix: staging not cleaned on partial up failure; N+1 container list; blocking I/O on tokio #84

@Jaro-c

Description

@Jaro-c

Problem

  1. STAGE-001: When up_with_options fails mid-way, the staging directory (inline secrets/configs) is not cleaned up. cleanup_temp_dir is only called in down_with_options.

  2. PERF-003 (engine/container.rs): The no-recreate loop calls is_container_running per container — each call is a list_containers API round-trip. With N services this is N+1 calls.

  3. PERF-004 (engine/build.rs): walkdir + file I/O runs on a tokio thread, blocking the async runtime.

  4. PERF-005 (engine/copy.rs): sync_to_container blocks the tokio thread during tar + I/O.

Fix

  1. Call self.cleanup_temp_dir() in the error path of up_with_options.
  2. Prefetch the full set of running containers once before the no-recreate loop; check names against the set.
  3. Wrap walkdir + file reads in tokio::task::spawn_blocking.
  4. Wrap sync_to_container tar building in tokio::task::spawn_blocking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions