Queue retry_after and the job that runs twice

The queue worker’s --timeout and the connection’s retry_after are two different clocks, and getting their order wrong is the most common cause of a job silently running twice.

// config/queue.php
'redis' => ['retry_after' => 90],

// and the worker
// php artisan queue:work --timeout=60

// retry_after MUST exceed timeout, or the queue releases the job
// back while the original worker is still processing it

With retry_after at 60 and a job that takes 75 seconds, the queue decides the job was lost and hands it to a second worker while the first is still running. Nothing errors; the work simply happens twice. A comfortable margin — timeout 60, retry_after 90 — and a job that is idempotent anyway, because this is not the only way a duplicate arrives.