Urgent.News

What's breaking now, across thousands of outlets.

Tech

Slow Jobs, Killer Containers: Laravel Queue Timeouts and Crashes in Docker

A job that sends an email takes half a second. A job that calls a generative model takes as long as the provider feels like, and sometimes a lot longer. Run that job in a Docker container and it has three ways to die: the worker timeout fires, the kernel kills it for memory, or a deploy pulls the container out from under it. Until this month Laravel treated those three deaths differently and…

In the world of Laravel, jobs can fail in three different ways when executed within Docker containers: worker timeout, kernel memory limit, and deploy pull. Laravel 13.33 and 13.34 have addressed two of these issues, but one remains reliant on user intervention. When a job exceeds its timeout, Laravel previously killed the worker using SIGKILL.

However, Laravel 13.34 now records the timeout as an exception when $failOnTimeout is set, allowing the job to retry and be counted towards the $maxExceptions limit. Additionally, Laravel 13.33 introduced a static flag, $killOnTimeout, which when set to false, allows the worker to survive a timeout, catching the TimeoutExceededException and continuing to the next job.

This change provides a more graceful handling of timeouts, allowing jobs to clean up resources and continue processing without requiring the framework to restart.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

First Post On Dev

My First Post on DEV Hi everyone! 👋 I'm Aditya, a developer from India. I've been spending most of my time learning how to build web applications and, more importantly, understanding what actually…

More from Thursday 1 October →