Add failOnTimeout to Scout job classes#983
Draft
JoshSalway wants to merge 1 commit into
Draft
Conversation
Scout jobs that timeout silently return to the queue and retry without being marked as failed, making it difficult to detect and diagnose indexing issues. Add failOnTimeout = true to ConfiguresJobOptions trait and MakeRangeSearchable so timed-out jobs are properly marked as failed. Fixes laravel#957 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scout jobs that exceed their timeout silently return to the queue and retry instead of being marked as failed. This makes it difficult to detect and diagnose indexing issues. Adds
failOnTimeout = trueto Scout job classes so timed-out jobs are properly recorded as failures.Fixes #957
Problem
Scout's
ConfiguresJobOptionstrait andMakeRangeSearchablejob do not set$failOnTimeout. When a search indexing job times out (e.g., due to a slow Meilisearch/Algolia API call), Laravel's default behavior is to release the job back to the queue for retry rather than marking it as failed.This means:
failed_jobsQueue::failing()callbacks are never triggeredSolution
Add
public bool $failOnTimeout = trueto theConfiguresJobOptionstrait andMakeRangeSearchablejob class, matching the pattern used in other Laravel first-party packages.Test Plan