Repository navigation
[2.1] Fixes #38280: Report nothing pending for a disabled alert (backport 2.1 #38279) - #38555
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskChanging disabled-alert progress to zero pending and processed-all could affect client monitoring, while additive enabled fields expose its state. Disabled alerts now report nothing pending or unread and are shown as not running, while diagnostics keep the stored offsets and delivery counts. The change adds an VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Issue
Cherry-pick of #38279 to
2.1(Fixes #38280). The change is identical: the backport has the same patch id as the main PR, and it applied with no conflicts.Why 2.1 needs it
The files this fix touches are the same on
2.1as onmain, so 2.1.0 has the bug. 2.1 also skips the backlog when an alert is enabled again, so the events a disabled alert reports as pending will never be sent. Upgrading from 2.0.2 to 2.0.x to 2.1 carries over the saved positions that 2.0 wrote the first time someone opened the page of an alert created disabled. Those alerts can be far behind, and opening their page is costly.Problem
A disabled alert has no job, so its saved position never moves. While it stayed off, every reader of "what is unread" counted from that position: "500+" pending on its page, unprocessed events in its diagnostics, a growing lag, and
processedEventsfalse. None of it would ever be sent.What this PR changes
AlertProgress.of, which for a disabled alert reports nothing pending or unread, and "processed all events" true, since enabling it starts from the latest event.currentOffsetandstartingOffset, because support needs them. What it delivered or failed before is still counted.eventsRecordanddiagnosticInfonow returnenabled, so a disabled alert does not look like a healthy idle one. The change is additive.The rule is recorded in
docs/decisions/2026-11-19-a-disabled-alert-has-nothing-pending.md.Not in this PR
The UI follow-up, #38286 (alert status and the enable switch), is still in review on
main. It gets its own 2.1 backport once it merges.Tests
AlertProgressTest(new): a disabled alert has nothing pending, never counts or lists change events, reports where it stopped and keeps what it handled. An enabled alert still reads from its position.AlertDeliveryIT: a disabled alert, whether it ran before or was created disabled with a row an older release wrote, reportsenabled: falseand nothing pending over REST. Once enabled, it delivers only what happens from then on.Local Java test run: PASSED
eeb430eff627(baseorigin/2.1)--scope full).