Queue hygiene: TTL + dead-letter, delivery dedupe, honest sweep timeout #18

Merged
ClaudiuSchuster merged 1 commit from oss-oo/queue-hardening-v024-ning20260924 into main 2026-09-24 17:41:48 +00:00
Owner

Follow-Up-Brain finding (relayed by the owner): a stale stream-pending entry looped forever — a steering-E2E artifact queued behind its own cwd lock. Root causes fixed systemically, plus one pre-v0.2.3 lost bell confirmed as the old silent-drop bug (child sess_9319e4cc, dispatched minutes before the v0.2.3 cutover — no code action, just confirmation).

  • TTL + dead-letter: pending entries older than ZDO_PENDING_TTL_S (default 86400) move to stream-dropped.json and are counted in the sweep line — the queue can no longer grow monotonically, nothing is silently lost.
  • Delivery dedupe: bells already delivered are never re-queued. dispatch.py now records INLINE (notify_parent-spawned) deliveries into stream-history.json — previously only swept deliveries were recorded, leaving both the dedupe and the delivery log blind for direct bells.
  • Honest sweep timeout: 180 s → ZDO_SWEEP_DELIVERY_TIMEOUT_S (default 1800). A delivered wake turn that outlives its waiter re-queued its own bell forever — the v0.2.1 lesson (watcher timeouts must exceed the work) reintroduced via the sweeper.
  • The live stale artifact was manually dead-lettered with a reason string.

Gates: make functional pass; Super-Linter slim v8.7.0 (pinned CI image, archive-verbatim) EXIT 0 (module grew past 1000 lines — C0302 joined the file-header disable list per the repo's flat-single-file design policy).

Follow-Up-Brain finding (relayed by the owner): a stale stream-pending entry looped forever — a steering-E2E artifact queued behind its own cwd lock. Root causes fixed systemically, plus one pre-v0.2.3 lost bell confirmed as the old silent-drop bug (child sess_9319e4cc, dispatched minutes before the v0.2.3 cutover — no code action, just confirmation). - **TTL + dead-letter**: pending entries older than `ZDO_PENDING_TTL_S` (default 86400) move to `stream-dropped.json` and are counted in the sweep line — the queue can no longer grow monotonically, nothing is silently lost. - **Delivery dedupe**: bells already delivered are never re-queued. `dispatch.py` now records INLINE (notify_parent-spawned) deliveries into `stream-history.json` — previously only swept deliveries were recorded, leaving both the dedupe and the delivery log blind for direct bells. - **Honest sweep timeout**: 180 s → `ZDO_SWEEP_DELIVERY_TIMEOUT_S` (default 1800). A delivered wake turn that outlives its waiter re-queued its own bell forever — the v0.2.1 lesson (watcher timeouts must exceed the work) reintroduced via the sweeper. - The live stale artifact was manually dead-lettered with a reason string. Gates: `make functional` pass; Super-Linter slim v8.7.0 (pinned CI image, archive-verbatim) EXIT 0 (module grew past 1000 lines — `C0302` joined the file-header disable list per the repo's flat-single-file design policy).
Queue hygiene: TTL + dead-letter, delivery dedupe, honest sweep timeout
All checks were successful
Checks / Functional checks (pull_request) Successful in 18s
bbda570114
Brain-reported finding: a stale stream-pending entry looped forever (steering
E2E artifact queued behind its own cwd lock). Root causes fixed systemically:

- stream.py sweep: entries older than ZDO_PENDING_TTL_S (default 86400) are
  dead-lettered to stream-dropped.json and counted in the sweep line — the
  queue can no longer grow monotonically.
- Delivery dedupe: bells already delivered (history record) are never
  re-queued; dispatch.py records INLINE deliveries into stream-history.json
  too (previously only swept deliveries were recorded, leaving the dedupe
  blind for direct notify_parent spawns).
- Sweep delivery timeout 180 s -> ZDO_SWEEP_DELIVERY_TIMEOUT_S (default
  1800): a delivered wake turn that outlives its waiter re-queued its own
  bell forever — the same class as the v0.2.1 lesson (watcher timeouts must
  exceed the work), reintroduced via the sweeper.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-Singularity/zcode-dispatch!18
No description provided.