Skip to main content

Chunk Lifecycle

How run_chunks.status protects worker ownership and prevents stale workers from completing or releasing chunks they no longer own.

Notes

  • Run creation inserts chunks as pending.
  • Coordinator dispatch marks selected pending chunks with dispatched_at as it enqueues bounded run.chunk.ready windows.
  • Workers can claim a chunk only when the owning run is running.
  • Completion and release both compare the stored lease timestamp to the worker's claimed lease.
  • Cancellation changes open chunks to cancelled.