Skip to content

broadcast: propagate subscriber exceptions instead of swallowing - #22

Merged
adnanhd merged 1 commit into
mainfrom
fix/broadcast-fail-loud
Jul 25, 2026
Merged

broadcast: propagate subscriber exceptions instead of swallowing#22
adnanhd merged 1 commit into
mainfrom
fix/broadcast-fail-loud

Conversation

@adnanhd

@adnanhd adnanhd commented Jul 25, 2026

Copy link
Copy Markdown
Owner

BroadcastDispatcher.dispatch wrapped every subscriber in try/except and only logged, so a raising subscriber (e.g. an assertion hook) could never fail the operation — the fire returned and the caller continued.

Now a subscriber exception propagates: earlier subscribers still run, the first exception aborts the rest of that fire and surfaces to the caller. Verified no consumer relied on the swallow (WorkQueue competing-consumer, RPCServer, and the @observe/Reporter path each have their own independent error handling and are untouched). Full suite green.

  • observers.py: drop the per-subscriber try/except in BroadcastDispatcher
  • tests: assert a raising subscriber propagates + earlier subscribers still ran

A raising subscriber on the default BroadcastDispatcher was caught and
logged, so it could never fail the operation it observed. Let it
propagate; earlier subscribers in the fire still ran, later ones don't.
Class-level (@observe/Reporter) subscribers and ConcurrentDispatcher
still isolate their own failures, and WorkQueue keeps its ack/nack/DLQ
path untouched.
@adnanhd
adnanhd merged commit 759b229 into main Jul 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant