Skip to content

Fix pattern consumer fails when a subscribed topic is deleted #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2025

Conversation

RobertIndie
Copy link
Contributor

Motivation

When a topic that a pattern consumer is subscribed to is deleted, the consumer's sub-consumer tries to reconnect. However, it encounters a "topic not found" error. Currently, this error causes all pending waiters to fail, leading to an AlreadyClosedException when consumer.ReceiveAsync() is called. This issue can disrupt other consumers.

Pulsar.Client.Api.AlreadyClosedException: Consumer is already closed
   at <StartupCode$Pulsar-Client>[email protected]() in xxx/src/Pulsar.Client/Internal/ConsumerImpl.fs:line 1444
   at [email protected](ResumableStateMachine`1& sm)
   at [email protected](ResumableStateMachine`1& sm)

To fix this, if a sub-consumer encounters a "topic not found" error during reconnection, we should simply remove that consumer from the pattern consumer instead of throwing an exception.

Modification

  • This change prevents pending waiters from failing when a consumer encounters a "topic not found" error during reconnection.

@Lanayx Lanayx merged commit f8562cf into fsprojects:develop Jun 20, 2025
2 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.

2 participants