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 job not logged in failed_jobs table if timeout occurs within database transaction #54173

Merged
merged 7 commits into from
Jan 17, 2025

Conversation

decaylala
Copy link
Contributor

This PR attempts to address #49389

When a job times out with an open database transaction on the same connection as the failed jobs table, rolling back the transaction ensures the failed job is logged correctly. Without this rollback, the transaction remains uncommitted. As a result, database updates are rolled back when the worker process is terminated, preventing the failed job from being saved.

Additionally, this PR ensures that any open database transactions are rolled back to the root level. This guarantees that nested transactions are also properly rolled back; otherwise, the failed job might not be logged in the database.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@decaylala decaylala requested a review from crynobone January 17, 2025 02:06
@taylorotwell taylorotwell merged commit 08c2101 into laravel:11.x Jan 17, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants