Skip to content

Two-phase commit of CI job assignment is subject to race condition

Scenario

  1. Runner A: requests job, gets job 123
  2. Runner A: writes to Redis: job 123 --runner_manager_A
  3. Runner B: Requests job, gets job 123 (still in ci_pending_builds!)
  4. Runner B: Writes to Redis: job 123 → runner_manager_B (OVERWRITES!)
  5. Runner A: DB transaction: remove from ci_pending_builds
  6. Runner B: DB transaction: tries to remove (already gone, but no error?)
  7. Both runners think they own job 123

Context: !206034 (comment 2828746611)

Edited by 🤖 GitLab Bot 🤖