Files
crewAI/lib
Devin AI 1b1639b862 fix: atomic writes and locking for JsonProvider checkpoints (#6125)
- JsonProvider.checkpoint() and acheckpoint() now write to a temp file
  then os.replace() for atomic file updates (no partial writes)
- Added threading.Lock to JsonProvider for sync path serialization
- Added asyncio.Lock to JsonProvider for async path serialization
- Added threading.Lock (_lineage_lock) to RuntimeState to protect
  read-update of _parent_id across concurrent checkpoint calls
- Added asyncio.Lock (_async_lineage_lock) to RuntimeState for async
- checkpoint_listener._do_checkpoint() now acquires _lineage_lock for
  the full read-write-update cycle
- Temp files are cleaned up on write failure
- Added 8 new tests: atomic write correctness, temp file cleanup on
  success/failure, async equivalents, and concurrent sync/async
  lineage preservation with 5 writers × 10 writes each

Co-Authored-By: João <joao@crewai.com>
2026-06-11 19:27:05 +00:00
..
2026-06-11 10:06:07 -07:00
2026-06-11 10:06:07 -07:00
2026-06-11 10:06:07 -07:00