In plain words
A queue holds jobs that don't need to finish during the request, and workers are separate processes that take jobs off it, retry the ones that fail and set aside the ones that never succeed.
Where you see it
When a Harbor customer upgrades, the request saves the order and answers at once. A job to send the receipt, render the invoice PDF and update the CRM goes onto a queue, such as BullMQ on Redis or Amazon SQS, and workers finish it seconds later.
What goes wrong
- Jobs that aren't safe to run twice
Most queues deliver at least once, so a worker that crashes after sending the receipt may send it again on retry. Make each job idempotent: check whether the work is already done before doing it.
- Retrying forever
A job that fails because its data is wrong fails on every retry and keeps workers busy. Cap the attempts, then move it aside to a dead-letter queue or failed list where someone will look at it.
- Nobody watching the queue
Workers die quietly and the queue grows to 200,000 jobs before a customer asks where their invoice is. Alert on queue depth and on the age of the oldest waiting job.
What to tell your agent
Quick check
Sign in to earn +10 XP for itA Harbor worker crashed right after emailing a receipt but before marking the job done. The queue retries it. What prevents a second email?