⚡ Process deletion targets concurrently within each phase #14
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/project-deletion-parallel-target-execution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #11/#12/#13, requested live while BLF's deletion was running on Fanyu (real runtime phase taking tens of minutes to stop 4,641 runs one at a time). Replaces the per-target sequential loop in executeProjectDeletion with a bounded worker pool (PROJECT_DELETION_TARGET_CONCURRENCY, default 12) applied within each phase; phases (runtime -> workspace -> bos -> records) still run strictly in order, preserving the plan's intended cleanup ordering. Shared task state (target Status/Error, persist()) is mutex-guarded; the actual K8s/BOS/Mongo I/O runs unlocked so workers genuinely overlap.
Tests: go build ./..., go test ./internal/api/... ./internal/store/... -race (all pass, zero race warnings, 75 pre-existing unrelated failures unchanged). Added TestProjectDeletionExecutesTargetsConcurrentlyAndCompletes (30 concurrent runs) to lock in that concurrent execution reaches the same end state as the old sequential loop.
🤖 Generated with Claude Code