Skip to content

feat: configurable queue monitoring for QueueChecker (#269) - #448

Merged
shyim merged 6 commits into
FriendsOfShopware:mainfrom
roboshyim:fix/269-configurable-queue-checker
Jul 26, 2026
Merged

feat: configurable queue monitoring for QueueChecker (#269)#448
shyim merged 6 commits into
FriendsOfShopware:mainfrom
roboshyim:fix/269-configurable-queue-checker

Conversation

@roboshyim

Copy link
Copy Markdown
Contributor

Summary

Implements #269.

Failed messenger queues (e.g. async_failed) that are drained manually were counted by QueueChecker, which led to false positives in System Status and frosh:monitor.

Changes

Setting Default Purpose
Exclude failed queues true Skip queue_name LIKE '%failed%'
Queues to monitor empty (all) Optional comma-separated allowlist
Per-queue grace times empty async:15, low_priority:60 overrides
Default queue grace time 15 Unchanged key, clearer label

Also fixes age math: the previous formula effectively required age > 2 × grace before warning. It now uses the real pending age in minutes.

Status current now includes the queue name, e.g. 42 mins (async).

Config UI

Extension config → Monitoring card (DE labels included).

Tests

OK (9 tests, 23 assertions)

Unit tests with mocked Connection / SystemConfigService (no kernel).

Test plan

  • Unit tests green
  • CI on PR
  • Manual: insert old row into async_failed → no warning with default config; warning when “Exclude failed queues” is off

…re#269)

Failed messenger transports (async_failed, …) were treated like live
queues and caused false positives in System Status / frosh:monitor.

- Exclude queue names containing "failed" by default (toggleable)
- Optional allowlist of queues to monitor
- Optional per-queue grace times (queue:minutes)
- Fix age calculation (was effectively ~2× the configured grace)
- Surface oldest queue name in the status current value
- Unit tests (9) covering filters, grace overrides, and age math
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates queue monitoring to evaluate each queue independently against configurable grace periods, optionally exclude failed queues, support an allowlist, and report the worst overdue queue.

  • Adds queue-monitoring settings and localized administration labels.
  • Corrects pending-message age calculation and includes the selected queue name in status output.
  • Adds unit and integration coverage for filtering, grace overrides, and the previously reported masking scenario.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains in the fix associated with the previous review thread.

Important Files Changed

Filename Overview
src/Components/Health/Checker/HealthChecker/QueueChecker.php Groups pending messages by queue and evaluates each queue against its applicable grace period, completing the fix for the previously reported masking behavior.
src/Resources/config/config.xml Adds configuration fields for failed-queue exclusion, monitored-queue selection, and per-queue grace periods.
tests/Components/Health/Checker/HealthChecker/QueueCheckerTest.php Extends database-backed coverage for queue filtering, grace overrides, and independent per-queue evaluation.
tests/Components/Health/Checker/HealthChecker/QueueCheckerUnitTest.php Adds focused coverage for queue configuration, age thresholds, and the prior cross-queue masking defect.

Reviews (5): Last reviewed commit: "fix: satisfy phpstan in QueueChecker wor..." | Re-trigger Greptile

Comment thread src/Components/Health/Checker/HealthChecker/QueueChecker.php Outdated
Replace hand-built SQL with Connection::createQueryBuilder(), matching
TaskChecker and keeping named parameters / ArrayParameterType for the
queue allowlist.
Keep mock-based QueueCheckerUnitTest for config/age edge cases, and put
back IntegrationTestCase coverage (real messenger_messages + QueryBuilder)
including failed-queue exclusion, allowlist, and per-queue grace.
@frosh-automation

Copy link
Copy Markdown
Contributor

Hey 👋,

I have created for you a Shopware installation with the current changes made here.

You can access the Shop here: https://vcd25vg-d3q7en6rd4dpu.zrh2.namespaced.app

The URL is only for FriendsOfShopware members.

Addresses Greptile P1 on FriendsOfShopware#448: a global oldest-message LIMIT 1 could
hide a newer message that already exceeded a shorter per-queue grace.

Fetch MIN(available_at) per queue_name and pick the worst offender
(furthest past its own grace, else oldest healthy age).
booleanAnd.rightAlwaysTrue after the overdue/healthy branch; simplify
comparison so shopware-cli extension validate --full is clean.
@shyim
shyim merged commit 60fb28a into FriendsOfShopware:main Jul 26, 2026
9 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.

2 participants