Repository navigation
[fix][broker] Return errors for discarded ACKs with receipts - #27128
Merged
poorbarcode merged 2 commits intoOct 27, 2026
Merged
Conversation
Respond to ACKs carrying a request ID when their consumer is unavailable or their topic is transferring, instead of leaving the client waiting for a timeout. Preserve ACK handling without receipts and transfer statistics. Add protocol regressions and asynchronous completion controls. Fixes apache#23261 Assisted-by: OpenAI Codex
poorbarcode
reviewed
Oct 27, 2026
Delay an in-flight ACK until the admin API unloads its topic, then check that the Java client's ACK future receives the correlated error response. Cover individual and cumulative ACKs, with no-unload success controls. Verify a second producer can still publish on the same connection while the close notification is delayed.
1 of 11 tasks
poorbarcode
approved these changes
Oct 27, 2026
lhotari
pushed a commit
that referenced
this pull request
Oct 28, 2026
(cherry picked from commit dcec727)
danrubAtPlanview
added a commit
to danrubAtPlanview/pulsar-dotpulsar
that referenced
this pull request
Nov 1, 2026
Three fixtures hard-coded apachepulsar/pulsar:4.0.9, and the three tests that need a broker fix that no published image has were skipped with a static Skip. They could only run after someone edited the code. BrokerImage reads two variables: - DOTPULSAR_TESTS_PULSAR_IMAGE replaces the default image - DOTPULSAR_TESTS_BROKER_FIXES lists the apache/pulsar pull requests that the image has, for example 27128,27082 The two unload rows of ConsumerTests (apache/pulsar#27128) and the row of TopicTransactionBufferPublishOrderTests (#27082) are skipped unless their number is in the list, with a message that says how to run them. Without the variables nothing changes: the same 14 integration tests are skipped. With DOTPULSAR_TESTS_BROKER_FIXES set on the default image the two ConsumerTests rows run and fail with the ack receipt timeout, which is the bug in that image. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #23261
Motivation
With ACK receipts enabled, an acknowledgment discarded during topic transfer or after a consumer becomes unavailable receives no response. The client waits for its request timeout even though the broker already knows that it will not process the ACK.
Modifications
ServiceNotReadywhen the topic is transferring, andConsumerNotFoundwhen the consumer is missing or its subscription future is pending, failed or cancelled.The end-to-end test delays an in-flight ACK, unloads its topic through the admin API, and then forwards the original ACK frame. It checks that the client ACK future fails with the correlated
ConsumerNotFoundresponse. The close-consumer notification remains delayed until a second producer successfully publishes on the same connection, ensuring that a disconnect cannot account for the failed ACK. The test covers individual and cumulative ACKs, with successful no-unload controls.Verifying this change
Against the original
ServerCnximplementation, the two end-to-end unload cases fail while waiting for the missing ACK response; both no-unload controls pass.With the fix, 40 tests passed, with zero failures, errors or skipped tests and retries disabled:
AckReceiptOnTopicUnloadTest: four end-to-end cases.ServerCnxTest.testAck*: 15 protocol cases covering unavailable consumers, topic transfer, receipt mode on/off, request/consumer ID correlation, and normal asynchronous ACK success/failure.ConsumerTest: 19 existing ACK state/completion cases.PulsarCommandSenderImplTest: two existing serialization cases.Repository-wide
sanityCheck, includingquickCheck, passed. Full CI for this revision is not yet verified.Does this pull request potentially affect one of the following parts:
Discarded ACKs that request receipts now receive an existing
ACK_RESPONSEerror instead of waiting for a timeout. No command, field or error code is added.