Skip to content

feat(alerts): offset order, destination order, a tick time budget, a stopping flag and recipient lookups - #33974

Merged
manerow merged 7 commits into
feat/alerting-redesign-7-channelsfrom
feat/alerting-redesign-8-tick-order
Oct 6, 2026
Merged

manerow merged 7 commits into
feat/alerting-redesign-7-channelsfrom
feat/alerting-redesign-8-tick-order

Conversation

@manerow

@manerow manerow commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34266

What this pull request implements

  • Order. Events are read and sent in the order they happened, and destinations are used in the order the alert lists them.
  • A time budget. A tick past its budget stops after its current event, commits and runs again at once, so one slow endpoint cannot hold a scheduler thread from other alerts. Default 60 seconds; 0 turns it off.
  • Fair turns. A waiting alert keeps its place in line.
  • Stopping. A stopping server finishes the event in progress, commits, and starts nothing more.
  • Recipient lookups answer found, absent or failed. A failed lookup is recorded as a failure; the recipients found still receive it.
  • Settings. A new alerting block in openmetadata.yaml holds the budget and skipUnreachableTargetWithinTick (off by default).

What was wrong before

Events and destinations were kept in hash maps, so a failure and its recovery could post in either order. A slow endpoint could hold a thread for a whole batch. On shutdown a tick went on until it was killed, so a restart resent what the interrupted run had delivered. A lookup that failed looked like an empty audience.

Design

  • The order of destinations also picks whose configuration is used when several share one.
  • The position moves after each event, so a tick can stop between two; an event that cannot be processed at all is recorded as failed and passed.
  • TickStopSignal ends a tick after its current event when the server is stopping or the budget has passed. A tick stopped for time schedules a one-off run of itself, behind alerts due earlier.
  • A ten-minute misfire threshold keeps waiting triggers in the order they fell due; five seconds would move a late one behind later ones. Quartz counts a repeating trigger's next slot from the one before, so a tick that ends past it restarts the trigger one interval later (AlertJobs.restartIfBehind, likewise for the audit log).
  • ServerStopping is set once the JVM is asked to stop.
  • AlertingSettings reads the alerting block; each tick uses its own server's values.
  • Lookup (a value, nothing or a failure) tells a deleted user from a failed read; recipient resolvers answer with Recipients: who was found and why the rest were skipped.
  • ConnectionFailures tells an unreachable target from one that answered with an error; nothing reads it yet.

What users notice

  • Notifications from one alert arrive in the order the changes happened.
  • A graceful restart does not resend what the interrupted run delivered, if the server may take longer to stop than its slowest single send.
  • A comment that also mentions a deleted user still notifies everyone else it mentions.

How it was tested

The alerting unit tests (80 classes, 561 tests), the alert integration tests (13 classes, 88 tests, including SlowEndpointIT and AlertTimetableIT) and the existing alert integration tests (565 tests) pass on MySQL and on PostgreSQL.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@manerow
manerow added this pull request to stack #33976 September 24, 2026 15:16
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit c284d1dc89711fd4ebb0def90e636fa48c2fc5e9 in Playwright run 37427452788, attempt 2.

✅ 3457 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 1h 10m 36s

⏱️ Max setup 4m 50s · max shard execution 21m 0s · max shard-job elapsed before upload 24m 46s · reporting 9s

🌐 212.82 requests/attempt · 2.01 app boots/UI scenario · 38.89% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 38.89% (convergence target: at most 15%).
  • Browser traffic was 212.82 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.01 per UI scenario (7369 boots / 3662 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 63 0 0 0 0 0
✅ Shard advanced-search-02 67 0 0 0 0 0
✅ Shard chromium-01 176 0 0 1 0 0
✅ Shard chromium-02 197 0 0 0 0 0
✅ Shard chromium-03 156 0 0 0 0 0
✅ Shard chromium-04 193 0 0 0 0 0
✅ Shard chromium-05 216 0 0 0 0 0
🟡 Shard chromium-06 187 0 2 0 0 0
✅ Shard chromium-07 193 0 0 0 0 0
✅ Shard chromium-08 183 0 0 0 0 0
✅ Shard chromium-09 238 0 0 0 0 0
✅ Shard chromium-10 195 0 0 0 0 0
✅ Shard chromium-11 169 0 0 0 0 0
✅ Shard chromium-12 206 0 0 0 0 0
🟡 Shard chromium-13 202 0 1 0 0 0
✅ Shard chromium-14 186 0 0 0 0 0
✅ Shard chromium-15 202 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard global-state-01 68 0 0 0 0 0
✅ Shard import-export-01 95 0 0 0 0 0
✅ Shard import-export-02 57 0 0 0 0 0
✅ Shard ingestion-01 27 0 0 0 0 0
✅ Shard ingestion-02 39 0 0 0 0 0
✅ Shard ingestion-03 27 0 0 0 0 0
✅ Shard reindex-01 41 0 0 0 0 0
✅ Shard search-rbac-01 9 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Features/Pagination.spec.ts › should test API Collection normal pagination (shard chromium-06, 1 retry)
  • Features/Pagination.spec.ts › should test Spreadsheets normal pagination (shard chromium-06, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Left hierarchy pagination and expand collapse actions work (shard chromium-13, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — stack_invalidated (2026-10-06T10:43:07Z)

The entry left the queue before it was built, so no checks ran against it.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — stack_invalidated (2026-10-06T13:07:12Z)

The entry left the queue before it was built, so no checks ran against it.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-06T14:09:57Z)

The entry left the queue before it was built, so no checks ran against it.

@gitar-bot

gitar-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Alert delivery ordering, tick budgets, shutdown behavior, and recipient resolution change.

Adds offset order, destination order, a tick time budget, a stopping flag and recipient lookups to the alerts system. Events and destinations are now processed in the order they occur; a configurable time budget (default 60 seconds) prevents slow endpoints from blocking scheduler threads; graceful shutdown finishes in-progress events without resending; and failed recipient lookups are recorded separately from empty audiences. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alert delivery is not isolated: one failing recipient silences its channel, a slow endpoint holds a scheduler thread, and a restart resends

2 participants