Skip to content

Add failOnTimeout to Scout job classes#983

Draft
JoshSalway wants to merge 1 commit into
laravel:11.xfrom
JoshSalway:fix/scout-957
Draft

Add failOnTimeout to Scout job classes#983
JoshSalway wants to merge 1 commit into
laravel:11.xfrom
JoshSalway:fix/scout-957

Conversation

@JoshSalway

@JoshSalway JoshSalway commented Mar 22, 2026

Copy link
Copy Markdown

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 = true to Scout job classes so timed-out jobs are properly recorded as failures.

Fixes #957

Problem

Scout's ConfiguresJobOptions trait and MakeRangeSearchable job 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:

  • Timed-out jobs silently retry without appearing in failed_jobs
  • Queue::failing() callbacks are never triggered
  • Monitoring tools cannot detect persistent timeout issues
  • Jobs can loop indefinitely between retry and timeout

Solution

Add public bool $failOnTimeout = true to the ConfiguresJobOptions trait and MakeRangeSearchable job class, matching the pattern used in other Laravel first-party packages.

Test Plan

  • Verify Scout import/flush jobs that exceed their timeout are marked as failed
  • Verify the failed job handler is triggered on timeout
  • Verify no regression for jobs that complete within timeout

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>
@github-actions

Copy link
Copy Markdown

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.

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.

When scout encounters timeout, the jobs never fail in Horizon and block the queue

1 participant