Skip to content

Trial orchestrator skips Cleanup entirely when an earlier stage fails, leaking resources #9

Description

@magic-peach

What's happening

In internal/orchestrator/orchestrator.go, runTrial's stage loop returns immediately on any stage error:

if err != nil {
    return failTrial(...)
}

This applies to every stage (Prepare/Create/Start/WaitReady/Stop). If any of them fails, Cleanup never runs for that adapter.

Why it matters

This tool manages real containers/VMs/network namespaces on the host as root. A single failed trial in a benchmark sweep can leave those resources behind, and since sweeps run many trials, this accumulates across a run rather than surfacing as one isolated failure.

Suggested direction

Run Cleanup on a best-effort basis regardless of which stage failed (e.g. via defer or an explicit cleanup call in the failure path), so a failed trial doesn't skip teardown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions