apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.13k stars 3.57k forks source link

[Bug] When ack receipts are enabled, no response is sent to the client if the topic has been unloaded or is being transferred #23261

Open lhotari opened 2 weeks ago

lhotari commented 2 weeks ago

Search before asking

Read release policy

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?

lhotari commented 1 week ago

This is needed by "PIP-377: Automatic retry for failed acknowledgements", #23267 .