HomeChallengesRepsProblemsLeaderboardTake a challenge

Two pods, two reports

A background job runs in every replica, so the ops team gets every report twice, and one exception ends the job for good. Make the pods take turns, make the job happen once per interval, and keep it alive.

Advanced25 min on the clock6 graded checks · 100 pointsWorks on One ServerPro
Graded by reading your code against the checklist below.

What you build

  • Register a Redis lock provider
  • Try to take the lock without waiting
  • Skip the run when another pod holds it
  • Release the lock when the run ends
  • Mark the interval as done, so it runs once
  • Keep one failed run from ending the job

Done means

A Redis lock taken without waiting and released with the handle, an interval marker so the work happens once, and a loop that survives a failed run.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. A Redis lock provider is registered+10Only one replica does the job
  2. The lock is tried, not waited for+25Only one replica does the job
  3. A held lock means skip this run+15Only one replica does the job
  4. The lock is released with the handle+20Only one replica does the job
  5. The interval is claimed, so it runs once+20Only one replica does the job
  6. One failed run does not end the job+10Running it in production

What it teaches

The rest of Works on One Server