Repository navigation
fix(alerts): bound the work of each alert request and tick - #36279
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 |
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/utils/Alerts/AlertsUtilPure.ts:41:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
…ot per destination
…atus # Conflicts: # openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/notification/NotificationAlertDetail.tsx
…yped errors from alert status routes
Code Review ✅ Approved 7 closed / 7 findings🔴 High risk · Removing embedded entities from alert event-listing responses changes the public API contract, so clients relying on those fields could break. Bounds alert reads, listings, chat rendering, pending counts, test sends, HTTP exchanges and mail queues to fixed limits, so one request or tick can no longer exhaust the heap or hold threads indefinitely. Resolved this session: receiver limits now cover user and team names, pending-count requests are queued behind the thread pool, timed-out test sends no longer alter the returned destination, PUT that removes receivers from an over-limit list is accepted, poll errors no longer advance the position past an unread batch, and fixture registry caches are bounded. No issues found. ✅ 7 closed✅ Quality: New alert limits and lower-bound fields are recorded in no decision record
✅ Bug: Pending-count requests can wait without limit behind a 4-thread pool
✅ Bug: A timed-out test send still changes the destination being returned
✅ Bug: PUT that removes a receiver from a stored over-limit list is refused
✅ Bug: USERS/TEAMS name lists escape the receiver limit, so sends do unbounded work
...and 2 more closed from earlier reviews 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 |
|
|
@greptileai review |
|
…2.1 #36279) (#36343) * fix(alerts): bound the work of alert status, settings, sends and mail * fix(alerts): bound the size of chat notifications while they are rendered * fix(alerts): bound alert event listings and leave the entity out of their rows * fix(alerts): read change events up to a byte budget, not only a row count * fix(alerts): address review of the bounded alert work * Update generated TypeScript types and dereferenced schemas * fix(alerts): forget a failed pending count before answering it * fix(alerts): let a destination keep the receivers it stored past the limit * fix(alerts): count only typed receivers against the receiver limit * fix(alerts): hold the receivers past the limit for the whole alert, not per destination * fix(alerts): keep the position when an Error ends a tick while its batch is read * fix(alerts): answer a template test send too large for its channel as a body error * fix(alerts): make the template preview fixture registry safe for concurrent requests * fix(alerts): keep no template preview fixture for a resource that has none * fix(alerts): bound the diagnostics page of unread events and answer typed errors from alert status routes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>



What was wrong
Alerting work grew without limit with what an alert held, a request asked for, or a user wrote, so one request or tick could fill the heap or hold threads forever:
batchSizewent straight to SQL, every change event embeds its whole entity, and the eight alert event listings had no row limit.eventsRecordanddiagnosticInfoevaluated every unread event on each view.batchSize, destinations and receivers had no upper bound; saving compared destinations in quadratic time.Error(for exampleOutOfMemoryError) was retried forever instead of being set aside.What this changes
Each path gets one fixed bound, recorded in
ADR:2026-10-26-alerting-bounds-the-work-of-each-request-and-tick:batchSizeentityAlso:
Errorkeeps its "in progress" note, so the existing set-aside after six attempts applies.What users see
entity.Before merging
Please check the bounds against real data: no stored alert should be near 1000 for
batchSize, 50 destinations or 100 receivers.Tests
Every new test failed on main first: for example, 500 nested quotes rendered 8,007,000 characters, three 5 MB events were read in one tick, and a test send to 51 destinations was accepted.
The decision record's
Guardline lists the tests.Passing: all 16 alert integration test classes on MySQL and Postgres (584 each) before the final receiver changes; after them, 614 unit tests and the affected integration tests (283) on MySQL.
This PR replaces PR #36258, PR #36261 and PR #36268. The 2.1 backport is PR #36343.
The changed preview caches need size caps before merging to satisfy the repository requirement.
Findings
Summary
This PR caps alert reads, listings, rendering, counts, test sends, HTTP exchanges, and mail queues. It also preserves edits to oversized stored alerts and keeps interrupted ticks eligible for recovery.
Reviews (11) · Last reviewed commit: "fix(alerts): make the template preview f..." · Reviewed by Greptile