← Inside orch contents

Chapter 18 — worked answers

1. Existing identity versus missing identity

DeleteService finds namespace-visible service identity before checking whether it is already deleting/deleted. Existing ownership can repeat safely, but a missing object cannot prove a previous workflow exists. The result is intentional idempotency with preserved identity, not a blanket success for every unknown request.

2. Agent owns runtime retry

The agent's desired-stop branch resolves the same owned object and repeats stop/remove. removeLocalContainer returns before removed reporting on failure, so finalization sees a task not yet removed. A second attempt can tolerate already-stopped state and finish removal. Evidence must distinguish the actual stop from the missing removal acknowledgement.

3. Metadata is not deletion authority alone

ContainerID can be stale or wrong. assignedContainerForRemoval checks managed identity and matching node/task labels, searches scoped labels when needed, and records drift instead of removing an unrelated object. Assert sentinel unchanged and record the mismatch; do not change its labels merely to satisfy cleanup.

4. Stopped is not removed; data is not the container

Default finalization requires ActualStatus removed, not stopped. Named volume data also has a lifecycle independent of task/container cleanup. Inspect each run-owned container, accept the removed task report, verify final service status, and inspect only recorded lab volumes. Broad pruning risks unrelated data and does not establish the missing workflow acknowledgement.

Return to Chapter 18.