Add red 'stalled' status to admin dashboard banner#499
Merged
Conversation
The dashboard banner now distinguishes three states instead of two:
- green Queue Running (heartbeat < dashboardIdleAfter, 60s default)
- yellow Queue Idle (heartbeat >= dashboardIdleAfter, or no heartbeat
and no backlog)
- red Queue Stalled (heartbeat >= dashboardStalledAfter, 120s default,
with a pending backlog AND no in-flight job; OR
no worker has reported at all and there is a
pending backlog or stuck in-flight job)
Red surfaces the case the old "Queue Idle" yellow blurred away: jobs are
piling up and nothing is processing them. The previous banner also showed
a muted info notice ("No queue status available") when every worker row
had aged past Queue.defaultRequeueTimeout — the worst-case full cron
outage. That path now produces the red banner too.
The conditions are tuned to avoid false positives:
- workers == 0 alone does not trigger red. In cron-driven mode that is
the normal idle state for a quiet system.
- runningJobs > 0 keeps a busy worker out of red. Heartbeats fire at the
top of each loop, not during runJob(), so a long-running task (>2 min)
with more pending behind it would otherwise look stalled by heartbeat
age alone.
When red, the banner expands with a diagnostic grid (last activity
absolute + relative, workers, pending) and a context-specific cause hint
that names the most likely fault and the relevant CLI command.
Thresholds are exposed as two new config keys:
- Queue.dashboardIdleAfter (default 60, seconds)
- Queue.dashboardStalledAfter (default 120, seconds)
Defaults are deliberate UI policy — human-perceptible 1-min / 2-min
boundaries — not derived from queue mechanics. None of the existing
config knobs (workerLifetime, defaultRequeueTimeout, sleeptime) actually
mean "dashboard heartbeat freshness", so deriving from them coupled the
banner to unrelated semantics. Installations with unusual cron cadence
(e.g. slow exitwhennothingtodo cron) should raise dashboardStalledAfter
past the cron interval to avoid false-red between ticks.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #499 +/- ##
=========================================
Coverage 78.34% 78.34%
Complexity 981 981
=========================================
Files 45 45
Lines 3330 3330
=========================================
Hits 2609 2609
Misses 721 721 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
The dashboard banner gains a third state so the operator sees a clear "action required" signal when work piles up and nothing is processing it.
Queue.dashboardIdleAfter(60s default)Queue.dashboardIdleAfter, OR no heartbeat & no backlogQueue.dashboardStalledAfter(120s default) with a pending backlog and no in-flight job; OR no worker has reported at all and there's a pending backlog or a stuck fetched jobWhen red, the banner expands with a small diagnostic grid (last activity absolute + relative, workers / servers, pending count) and a one-line cause hint that names the likely fault and the relevant CLI command. See screenshots below.
What red replaces
Two cases were previously ambiguous or hidden:
queue_processesrow aged pastQueue.defaultRequeueTimeout,QueueProcessesTable::status()returns empty and the previous template fell through to a muted info notice ("No queue status available"). That's the worst case and is now the loudest red.Conditions that keep red from false-positiving
workers == 0alone does not trigger red. In cron-driven mode that's the normal idle state for a quiet system, so red also requirespendingJobs > 0.runningJobs > 0keeps a busy worker out of red. Heartbeats fire at the top of the worker loop, not duringrunJob(), so a long-running task (>2 min) with more pending behind it would otherwise look stalled by heartbeat age alone.runningJobsis already computed in the controller (fetched IS NOT NULL AND completed IS NULL).Config
Two new keys in the example config:
Defaults are deliberate UI policy — human-perceptible 1-min / 2-min boundaries — not derived from queue mechanics. The existing knobs (
workerLifetime,defaultRequeueTimeout,sleeptime) describe exit policy / job-reassignment safety / idle sleep cadence respectively; none of them actually mean "how stale before the dashboard should nag the admin." Installations with unusual cron cadence (e.g. slowexitwhennothingtodocron) should raisedashboardStalledAfterpast the cron interval to avoid false-red between ticks.Files
templates/Admin/Queue/index.php— three-state banner, conditional red, no-status path also red on backlog/in-flight, diagnostic grid + cause hinttemplates/layout/queue.php—.status-banner.status-stalledCSS (red gradient + 4 px left accent)config/app.example.php— newQueue.dashboardIdleAfterandQueue.dashboardStalledAfterkeys with explanation