Skip to content

KAFKA-20309: Limit SharePollEvent to single instance#21757

Open
AndrewJSchofield wants to merge 1 commit intoapache:trunkfrom
AndrewJSchofield:KAFKA-20309
Open

KAFKA-20309: Limit SharePollEvent to single instance#21757
AndrewJSchofield wants to merge 1 commit intoapache:trunkfrom
AndrewJSchofield:KAFKA-20309

Conversation

@AndrewJSchofield
Copy link
Member

@AndrewJSchofield AndrewJSchofield commented Mar 14, 2026

When a share consumer is initially joining a group but not yet fetching
records, the poll loop has no records to wait for. Each iteration of the
loop was creating an instance of SharePollEvent without considering
whether an in-flight event existed. As a result, many events could
briefly queue up for no good reason, only to be drained once the
consumer successfully joined the group.

The PR follows a similar design as used in the AsyncKafkaConsumer for
managing its poll event, without that code's extra complication of
validating the position.

Copy link
Collaborator

@TaiJuWu TaiJuWu left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants