Skip to content

KAFKA-20187: Fix for AsyncKafkaConsumer not clearing endOffsetRequested flag - #23123

Merged
AndrewJSchofield merged 3 commits into
apache:trunkfrom
ezhou413:ezhou/kafka-20187
Aug 13, 2026
Merged

KAFKA-20187: Fix for AsyncKafkaConsumer not clearing endOffsetRequested flag#23123
AndrewJSchofield merged 3 commits into
apache:trunkfrom
ezhou413:ezhou/kafka-20187

Conversation

@ezhou413

@ezhou413 ezhou413 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Fixes an issue for the AsyncKafkaConsumer where the endOffsetRequested
flag is not cleared on failed LIST_OFFSETS calls.

Reviewers: Andrew Schofield aschofield@confluent.io

@github-actions github-actions Bot added triage PRs from the community consumer clients labels Aug 10, 2026

@AndrewJSchofield AndrewJSchofield left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Overall, looks good. A few minor comments to address.

if (subscriptionState.partitionEndOffset(topicPartition, isolationLevel) == null &&
offsetFetcherUtils.maybeSetPartitionEndOffsetRequest(topicPartition)) {

Map<TopicPartition, Long> timestampToSearch = Collections.singletonMap(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Map.of(_,_) is preferred nowadays.

boolean requireTimestamps,
boolean oneShot) {
if (timestampsToSearch.isEmpty()) {
return CompletableFuture.completedFuture(Collections.emptyMap());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not the changed code, but we prefer Map.of() nowadays.

consumer.poll(Duration.ofMillis(0));
}

// Since the AsyncConsumer uses a background thread, add this barrier here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, adding this wait is just aligning this test with the others so this comment is a bit out of place. I would remove the comment for consistency.

@github-actions github-actions Bot removed the triage PRs from the community label Aug 13, 2026

@AndrewJSchofield AndrewJSchofield left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I particularly like how three of the KafkaConsumerTest test cases now apply to modern consumer groups too.

@AndrewJSchofield
AndrewJSchofield merged commit e5e26ab into apache:trunk Aug 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants