Skip to content

Conversation

@swelborn
Copy link
Contributor

Description

Suppress another nats error when fetching messages on subscriptions.

ServiceUnavailableError intermittently pops up during jetstream leader elections. My services get stuck in an infinite supervisor loop (see #2632 for more details).

Since the issue is transient it is a bit difficult to test, but one way I have managed to reproduce is to use a jetstream cluster with 3 replicas, connect with a faststream subscriber, then shut down the cluster, and bring them back up one at a time.

I think that since this error is transient, it is in line with a TimeoutError, so it should be fine to suppress.

Fixes # (issue number)

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

@swelborn swelborn requested a review from Lancetnik as a code owner December 18, 2025 21:15
@github-actions github-actions bot added the NATS Issues related to `faststream.nats` module and NATS broker features label Dec 18, 2025
@Lancetnik Lancetnik enabled auto-merge December 18, 2025 21:17
@Lancetnik Lancetnik added this pull request to the merge queue Dec 18, 2025
Merged via the queue into ag2ai:main with commit 27be1a1 Dec 18, 2025
32 checks passed
@swelborn swelborn deleted the suppress-service-unavailable branch December 18, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NATS Issues related to `faststream.nats` module and NATS broker features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants