Follow-up to #1574.
AnalysisNwbfile.cleanup() currently documents a single-cleanup-process
contract. Trigger creation/removal is not owned by a run: overlapping runs can
adopt and remove one another's triggers, a partial acquisition can leave
inserts blocked, and registry changes can strand triggers.
Acceptance criteria
- Serialize cleanup with a MySQL advisory lock or equivalent database-wide
lease.
- Reject or explicitly recover from pre-existing/stale cleanup triggers.
- Have trigger acquisition return the exact triggers created by this run.
- Roll back only those owned triggers after partial acquisition failure.
- Drop only owned triggers during normal release.
- Preserve the original cleanup exception while making release failures loud.
- Add DB-backed tests for overlap, pre-existing triggers, partial acquisition,
registry changes, and stale recovery instructions.
This issue covers cleanup-run ownership, not the separate writer-registration
race.
Follow-up to #1574.
AnalysisNwbfile.cleanup()currently documents a single-cleanup-processcontract. Trigger creation/removal is not owned by a run: overlapping runs can
adopt and remove one another's triggers, a partial acquisition can leave
inserts blocked, and registry changes can strand triggers.
Acceptance criteria
lease.
registry changes, and stale recovery instructions.
This issue covers cleanup-run ownership, not the separate writer-registration
race.