apache / apache/pulsar-client-go
[Bug] Consumer should retry for the subscription fence error
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
This CI failure exposed the issue: https://github.com/apache/pulsar-client-go/actions/runs/15014358114/job/42188862912#step:6:2767
#### Actual behavior
Consumer will fail immediately without any retry for the subscription fence error.
```
time="2025-05-14T07:09:02Z" level=error msg="Failed to create consumer" consumerID=8 error="server error: ServiceNotReady: Subscription is fenced" name=ypbxo subscription=my-sub topic="persistent://public/default/my-topic-437318013-partition-0"
```
```
consumer_test.go:2346:
Error Trace: /pulsar/pulsar-client-go/pulsar/consumer_test.go:2346
Error: Expected nil, but got: &errors.errorString{s:"server error: ServiceNotReady: Subscription is fenced"}
Test: TestConsumerAddTopicPartitions
```
#### Expected behavior
Consumer should retry for the subscription fence error
Contributor guide
Research direction
Start with the failing TestConsumerAddTopicPartitions in consumer_test.go, especially the assertion at line 2346, and review the CI failure linked in the issue. Trace the consumer creation path for the subscription-fenced error; done means the consumer retries instead of returning that error immediately and the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100