Here’s a cool post by Tom McFarlin how you can use Ray in WordPress to easily see a the callers of a function. This doesn’t only work in WordPress but any Laravel and PHP app.
PHP
Laravel Deadlocks: Queue Jobs That Already Ran End Up in failed_jobs
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. Read more