Repository navigation
feat(alerts): offset order, destination order, a tick time budget, a stopping flag and recipient lookups - #33974
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
✅ Playwright Results — workflow succeededValidated commit ✅ 3457 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
🟡 3 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
…stopping flag and recipient lookups
…ed once and health per destination
…, fails the event with its reason
🚦 Removed from the merge queue —
|
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. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #34266
What this pull request implements
0turns it off.alertingblock inopenmetadata.yamlholds the budget andskipUnreachableTargetWithinTick(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
TickStopSignalends 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.AlertJobs.restartIfBehind, likewise for the audit log).ServerStoppingis set once the JVM is asked to stop.AlertingSettingsreads thealertingblock; 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 withRecipients: who was found and why the rest were skipped.ConnectionFailurestells an unreachable target from one that answered with an error; nothing reads it yet.What users notice
How it was tested
The alerting unit tests (80 classes, 561 tests), the alert integration tests (13 classes, 88 tests, including
SlowEndpointITandAlertTimetableIT) and the existing alert integration tests (565 tests) pass on MySQL and on PostgreSQL.