Managing Long Running Tasks hard
What is a 'Poison Pill' (or Message of Death) in a queue, and how do you handle it?
- A A virus.
- B A malformed message that crashes the consumer code immediately. Since the consumer crashes, the message is not deleted and goes back to the queue (due to Visibility Timeout), causing an infinite crash loop. Solution: Limit Maximum Receives and move to Dead Letter Queue (DLQ).
- C A delete command.
- D A message that deletes the database.
Answer: B. A malformed message that crashes the consumer code immediately. Since the consumer crashes, the message is not deleted and goes back to the queue (due to Visibility Timeout), causing an infinite crash loop. Solution: Limit Maximum Receives and move to Dead Letter Queue (DLQ).
These are the most dangerous reliability threats in async systems.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the primary purpose of a Dead Letter Queue (DLQ)?
- The architectural pattern where one service creates tasks and another processes them is called:
- In a Priority Queue system (High vs Low), what is 'Starvation' and how do you fix it?
- How do you atomically update your local database AND publish a message to a queue without losing sync if the process crashes in between?
- What does 'Fire and Forget' mean?
- Why might you 'Throttle' (limit the speed of) your background workers?