Skip to content

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

Closed
AuroraTwinkle/pulsar
#15

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • 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:

} else {
if (log.isDebugEnabled()) {
log.debug("Consumer future is not complete(not complete or error), but received command ack. so discard"
+ " this command. consumerId: {}, cnx: {}, messageIdCount: {}", ack.getConsumerId(),
this.toString(), ack.getMessageIdsCount());
}
}

and
var pulsar = getBrokerService().getPulsar();
var ignoredAckCount = ack.getMessageIdsCount();
var ignoredAckTotalCount = ExtensibleLoadManagerImpl.get(pulsar).getIgnoredAckCount().
addAndGet(ignoredAckCount);
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Ignoring {} message acks during topic transfer. Total ignored ack count: {}",
subscription, consumerId, ignoredAckCount, ignoredAckTotalCount);
}
return;

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Sep 5, 2024
  2. lhotari commented on Sep 7, 2024

    @lhotari
    MemberAuthor

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

  3. merlimat commented on Oct 24, 2026

    @merlimat
    Contributor

    Still present on master. In pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java, handleAck drops acks during a topic transfer with a bare return (lines 3170-3181) and only logs at debug when the consumer isn't found or isn't ready (lines 3203-3207). Neither path sends an ack response when the command carries a request id, so a client with ack receipts enabled waits for a response that never arrives. The likely fix is to send Commands.newAckResponse with an error code on both paths when ack.hasRequestId() is set.

  4. added
    bug-verified
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/brokerbug-verifiedtype/bug

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions