You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FastStream health check pings only the first broker of a multi-broker app #293
FastStreamHealthChecksInstrument._define_health_status pings config.application.broker and nothing else (lite_bootstrap/bootstrappers/faststream_bootstrapper.py:110). In FastStream that property returns self.brokers[0]. An app that holds more than one broker, for example through add_broker in FastStream 0.7, reports healthy while every broker after the first is down.
Services that need the other brokers checked set health_checks_enabled=False and mount their own route, which drops the OpenTelemetry span and response format the built-in check provides.
Proposal
Ping every broker in config.application.brokers and report healthy only when all of them answer. brokers exists from FastStream 0.6, so this works across the current faststream>=0.6 floor. Running the pings concurrently keeps the total wait within faststream_health_check_broker_timeout.
Acceptance
An app with two brokers where the second fails its ping gets a 500 from the health route.
Category: bug Summary: The FastStream health check must ping every broker the app holds, not only the first.
Verified: I built an AsgiFastStream with two RedisBrokers (the second added with add_broker), patched the first broker's ping to return True and the second's to return False, and called the health route. It returned 200, and the second broker's ping was never called.
Current behavior:
The FastStream health check pings only application.broker, which FastStream defines as brokers[0]. An app with several brokers reports healthy while any broker after the first is down. An app with no broker reports unhealthy.
Desired behavior:
The health check pings every broker in application.brokers and reports healthy only when all of them answer True. The pings run concurrently, each with faststream_health_check_broker_timeout, so the route's total wait stays within one timeout rather than one per broker. An app with no brokers still reports unhealthy. The response bodies and status codes for the healthy and unhealthy cases stay as they are.
Key interfaces:
FastStreamHealthChecksInstrument: the method that decides health status reads application.brokers instead of application.broker.
FastStreamConfig.faststream_health_check_broker_timeout: unchanged, applied to each ping.
application.brokers exists from FastStream 0.6, so the faststream>=0.6 floor stays.
Acceptance criteria:
With two brokers where the second's ping returns False, the health route returns 500.
With two brokers that both answer True, the health route returns 200, and each broker's ping is called once with the configured timeout.
With one broker, the existing health-check tests pass unchanged.
With no broker, the route still reports unhealthy.
Activity
lesnik512 commentedon Oct 20, 2026
Agent Brief
Category: bug
Summary: The FastStream health check must ping every broker the app holds, not only the first.
Verified: I built an
AsgiFastStreamwith twoRedisBrokers (the second added withadd_broker), patched the first broker'spingto returnTrueand the second's to returnFalse, and called the health route. It returned 200, and the second broker'spingwas never called.Current behavior:
The FastStream health check pings only
application.broker, which FastStream defines asbrokers[0]. An app with several brokers reports healthy while any broker after the first is down. An app with no broker reports unhealthy.Desired behavior:
The health check pings every broker in
application.brokersand reports healthy only when all of them answerTrue. The pings run concurrently, each withfaststream_health_check_broker_timeout, so the route's total wait stays within one timeout rather than one per broker. An app with no brokers still reports unhealthy. The response bodies and status codes for the healthy and unhealthy cases stay as they are.Key interfaces:
FastStreamHealthChecksInstrument: the method that decides health status readsapplication.brokersinstead ofapplication.broker.FastStreamConfig.faststream_health_check_broker_timeout: unchanged, applied to each ping.application.brokersexists from FastStream 0.6, so thefaststream>=0.6floor stays.Acceptance criteria:
pingreturnsFalse, the health route returns 500.True, the health route returns 200, and each broker'spingis called once with the configured timeout.Out of scope: