Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fix unique job lock is not released on model not found exception, lock gets stuck. #54000

Merged
merged 15 commits into from
Jan 17, 2025
Merged
Prev Previous commit
Next Next commit
refactor: changed the line for ensureUniqueJobLockIsReleasedWithoutIn…
…stance()
  • Loading branch information
zackAJ committed Dec 22, 2024
commit 78b07bfdbaa4f0e2cc02cfcc4c517aab2d6d84bf
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/CallQueuedHandler.php
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ protected function ensureUniqueJobLockIsReleasedWithoutInstance()
protected function handleModelNotFound(Job $job, $e)
{
$class = $job->resolveName();
$this->ensureUniqueJobLockIsReleasedWithoutInstance();

try {
$reflectionClass = new ReflectionClass($class);

@@ -249,6 +249,8 @@ protected function handleModelNotFound(Job $job, $e)
return $job->delete();
}

$this->ensureUniqueJobLockIsReleasedWithoutInstance();

return $job->fail($e);
}