Skip to content

Commit 78ceb3e

Browse files
authored
Merge pull request #563 from frstrtr/dashboard/d-miner5-undelivered-retry-kat
d-miner5(kat): pin undelivered-no-throttle (failed alert must retry, never masquerade as handled)
2 parents 609db5e + c2abbd2 commit 78ceb3e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

scripts/miner_notify_engine.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,20 @@ def put(ts, worker, hr):
441441
"detail": "d"}, sub)
442442
check(thr and thr["status"] == "throttled", f"expected throttled, got {thr}")
443443

444+
# 8b) honesty: a prior *undelivered* row must NOT throttle the retry — an
445+
# alert that never reached the miner has to be reattempted, not silently
446+
# suppressed (a failed send must never masquerade as handled). Guards the
447+
# status='delivered' filter in recently_sent against a throttle-all-rows
448+
# regression that would turn a dropped alert into a permanent health-lie.
449+
con.execute("INSERT INTO notifications(ts,worker,kind,severity,route,status)"
450+
" VALUES(?,?,?,?,?,?)",
451+
(t0, "w5", OFFLINE, "warn", "x", "undelivered"))
452+
con.commit()
453+
rt = route_event(con, {"worker": "w5", "kind": OFFLINE, "ts": t0 + 10,
454+
"detail": "d"}, sub)
455+
check(rt and rt["status"] == "deliver",
456+
f"undelivered must not throttle retry, got {rt}")
457+
444458
# 9) no subscription -> route_event returns None (logged undelivered, not dropped)
445459
nosub = dict(sub, enabled=0, channels=[])
446460
check(route_event(con, info_ev, nosub) is None, "unsub should route to None")
@@ -451,7 +465,7 @@ def put(ts, worker, hr):
451465
for f in fails:
452466
print(" -", f)
453467
return 1
454-
print("SELFTEST OK (13/13)")
468+
print("SELFTEST OK (14/14)")
455469
return 0
456470

457471

0 commit comments

Comments
 (0)