Skip to content

[12.x] Improve Queues and Horizon documentation #10596

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

Draft
wants to merge 5 commits into
base: 12.x
Choose a base branch
from

Conversation

QuentinGab
Copy link

@QuentinGab QuentinGab commented Jul 11, 2025

About

This PR is based on a recent post I shared on X, where I discussed some pain points around Horizon.

I did my best to avoid injecting strong personal opinions or turning the documentation into a blog post.

Queues:

Clarifies how job attempts are counted and how failed jobs are handled. Adds updated examples and notes for middleware and retries.

Horizon:

Adds sections on queue priorities, job attempts, timeouts, and backoff. Improves explanations for environment configuration and worker balancing.

There are still options left to document.

Reflections on maxException and tries Defaults

While working on this PR, I strongly felt the need for an option to configure maxExceptions at the Horizon supervisor or queue worker level, similar to how tries can currently be set.

Additionally, I’m wondering whether the default value for tries is appropriate. Many of Laravel’s advanced queue features, such as WithoutOverlapping and RateLimited, often require increasing the tries value significantly, sometimes even setting it to 0.

In my opinion, the default configuration should be more aligned with these common use cases. A more sensible default might look like:

  • tries: 25
  • maxException: 1

This defaults would work better out of the box for most Laravel developers .

@@ -1213,7 +1215,21 @@ class ProcessPodcast implements ShouldQueue
<a name="max-attempts"></a>
#### Max Attempts

If one of your queued jobs is encountering an error, you likely do not want it to keep retrying indefinitely. Therefore, Laravel provides various ways to specify how many times or for how long a job may be attempted.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section was confusing to me, as it mixed errors and attempts, so I tried to explain as clearly as possible what an ‘attempt’ is.

Comment on lines +1436 to +1438
> [!NOTE]
> A job marked failed will never be retried.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be redundant, but I added it for people who might not read the entire documentation as they should

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.

1 participant