Make cache, squad, and override persistence atomic and concurrency-safe #3
Labels
No labels
architecture
cleanup
dependencies
performance
priority: high
priority: medium
reliability
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
solvreven/FPL#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Finding
Persistent JSON state is written directly to the destination path:
backend/web/pipeline.py:774-780(save_cache)backend/web/main.py:1131-1136(squad)backend/web/overrides.py:87-103(read-modify-write overrides)FastAPI runs synchronous endpoints in a worker thread pool, so overlapping refresh, firm-up, override, and squad requests can interleave. Direct
Path.write_text()also exposes readers to partially written JSON.get_state()explicitly anticipates a half-written cache, but retrying later does not prevent lost writes or a process crash leaving a truncated file. Override updates have a classic read-modify-write lost-update race.Suggested direction
Acceptance criteria
Implemented on main in commit
202b69eand covered by regression tests. Closing as complete.