Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Oct 21, 2025

Fixes #516

Motivation

#490 changes the ack tracker's behavior by flushing the pending requests when the object is destructed (via calling shared_ptr::reset). However, it could expose the null pointer to other methods like acknowledge.

Modifications

Forbid resetting the ack grouping tracker by making it a const field of ConsumerImpl. After the consumer is Closing, prevent any new ACK request by failing it with ResultAlreadyClosed. The doImmediateAck methods are moved to ConsumerImpl so that we can just hold a weak reference to ConsumerImpl for state check and ack flush.

@BewareMyPower BewareMyPower added this to the 3.8.0 milestone Oct 21, 2025
@BewareMyPower BewareMyPower self-assigned this Oct 21, 2025
@BewareMyPower BewareMyPower added the bug Something isn't working label Oct 21, 2025
@BewareMyPower BewareMyPower marked this pull request as draft October 21, 2025 14:13
@BewareMyPower BewareMyPower marked this pull request as ready for review October 24, 2025 05:09
@BewareMyPower BewareMyPower marked this pull request as draft October 24, 2025 05:14
@BewareMyPower BewareMyPower marked this pull request as ready for review October 24, 2025 10:44
@BewareMyPower BewareMyPower merged commit 648b48b into apache:main Oct 27, 2025
14 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-ack-in-listener-crash branch October 27, 2025 07:20
BewareMyPower added a commit that referenced this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Segmentation fault on acknowledgeCumulativeAsync called in the listener

2 participants