[Bug] When ack receipts are enabled, no response is sent to the client if the topic has been unloaded or is being transferred
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Read release policy
- [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
### Version
any released version, master branch
### Minimal reproduce step
This was found when analysing the source code, so no reproducer yet.
A test application that consumes and acks messages while a topic is being frequently unloaded will reproduce this issue.
### What did you expect to see?
When ack receipt is enabled, the broker should respond with a failure when it discards an ack.
### What did you see instead?
When the consumer isn't found, it's silently discarded. There's debug logging, but no ack receipt response logic to respond with an error:
https://github.com/apache/pulsar/blob/6c300f515dbf245620b14a844d9ff6215426e992/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1982-L1988
and
https://github.com/apache/pulsar/blob/6c300f515dbf245620b14a844d9ff6215426e992/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1952-L1960
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start in pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java at the referenced lines around 1952-1960 and 1982-1988. Trace the ack handling path for missing consumers and how ack receipts are enabled, then reproduce with a consumer acknowledging messages while its topic is frequently unloaded. Done means discarded acknowledgements produce a failure response when receipts are enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100