28/28
Part 6 of 6 · Follow-upsCheck yourself
Check yourself
6 questions
  1. 1.w1 reserves task a. Then w2 calls ack("w2", "a"). What should the queue do?

  2. 2.a, b and c are enqueued in that order. w1 takes a, w2 takes b, and w1 fails a. What does the next reserve return?

  3. 3.max_attempts is 3. How many times can a task be reserved before it goes to the dead-letter queue?

  4. 4.A lease made at time 0 with a visibility timeout of 10. At what time does the holder's ack first return False?

  5. 5.A task with cooldown 4 has a lease that ends at 10. The queue first notices at 12. When can the task be reserved again?

  6. 6.A worker's lease ran out while its machine was frozen. It wakes up and writes its result after the next holder already wrote. What stops the stale write?

Now the problem this lesson builds to: 55 A work queue that survives failuresPractice it