{"slug": "laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs", "title": "Laravel Deadlocks: Queue Jobs That Already Ran End Up in failed_jobs", "summary": "Laravel queue workers on MySQL versions below 8.0.1 — or on servers where Laravel misreads the database version — reserve jobs using a plain FOR UPDATE lock and can deadlock on the DELETE, leaving jobs that already ran in the failed_jobs table. A single tinker line reveals which locking mechanism a given installation uses. The finding matters for developers running Laravel queues on older MySQL, who can check their lock type before deadlocks cause duplicate job failures.", "body_md": "Below MySQL 8.0.1, or on a server Laravel misreads, workers reserve jobs with a plain FOR UPDATE and can deadlock on the DELETE. One tinker line shows which lock yours use.\n\nGet my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.\n\nNo spam. Unsubscribe anytime.\nYou can also follow me on X.\n\n\"As a Laravel developer, this is the one newsletter I most look forward to. Freek has a talent for distilling packages or techniques down to something immediately useful - one tip can save you hours and even weeks. It's concise and practical and highly relevant.\"", "url": "https://wpnews.pro/news/laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs", "canonical_source": "https://freek.dev/3208-laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs", "published_at": "2026-10-26 13:50:42+00:00", "updated_at": "2026-11-09 15:21:25.481423+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Laravel", "MySQL", "failed_jobs", "Freek Van der Herten", "Spatie", "Oh Dear"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs", "markdown": "https://wpnews.pro/news/laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs.md", "text": "https://wpnews.pro/news/laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs.txt", "jsonld": "https://wpnews.pro/news/laravel-deadlocks-queue-jobs-that-already-ran-end-up-in-failed-jobs.jsonld"}}