Menu

Your Laravel jobs are running twice: retry_after vs timeout
📰

Your Laravel jobs are running twice: retry_after vs timeout

DEV Community: laravel·Ivaylo Nikolov·6 days ago
#LFvO5Qvo
#devtolaravel#devto#dev#timeout#retry_after
Long article (1059 words) — no AI summary yet.
Reading 0:00
15s threshold

NewSumm reads news from hundreds of outlets and groups articles about the same event into one story. All of that happens in queued jobs: fetching feeds, grouping articles, writing summaries. Some of those jobs take several minutes.

For a while, our failed jobs table kept filling up. 726 failures , nearly all of them TimeoutExceededException , spread across fetching, grouping and summarising. Nothing was obviously broken. The jobs worked when we ran them by hand. They just kept failing in production, and the summaries kept costing more than they should.

The cause was two numbers in two different files.

Two timers that sound like the same thing

Laravel queues have two settings that are easy to mix up.

The job timeout is how long a single job is allowed to run before the worker stops it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.