phenotypic.sdk_.sweep_orphan_parts#
- phenotypic.sdk_.sweep_orphan_parts(results_root: Path, *, min_age_seconds: float = 21600) int[source]#
Remove stale orphaned
.part/.trashdirectories.A uuid identifies the attempt, not whether its process is alive. The staged SLURM engine explicitly assumes stale workers can still be running – that is what
assert_active_epochexists for – and under an array the tasks share one output root and start at different times. A sweep with no liveness signal wouldrmtreethe.partdirectories its siblings are actively filling, which is the same defect a PID-based sweep has.Two guards, both required:
age: only directories whose mtime is older than min_age_seconds are removed;
placement: the caller must run this from the controller before any worker is submitted, not from each worker’s start-up (see Phase 3).
The scan is bounded to
results/<dataset>/zarr/rather than recursive:rglobwould descend into every store, which is the same ~400k-stat pathology the spec flags for the GUI’s discovery path.