[
https://issues.apache.org/jira/browse/FLINK-40362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113828#comment-18113828
]
Martijn Visser edited comment on FLINK-40362 at 9/11/26 2:51 PM:
-----------------------------------------------------------------
Fixed in apache/flink-connector-kafka
main 48ddbf1fd5d6d3d60ed30ec4ab0780f70f9cbc51
v5.0 3b4a558c3fd60f9f9f9004f860a0676d08b954b8
v4.0 11cfba97e8c187ef7b614c402fc85aa3509e4aea
v3.4 22310e625ecfe352a217035297f90d1d8ec10e63
was (Author: martijnvisser):
Fixed in apache/flink-connector-kafka:main
48ddbf1fd5d6d3d60ed30ec4ab0780f70f9cbc51
Pending backports to:
v5.0
v4.0
v3.4
> DynamicKafkaSource idle reader never finishes when no-more-splits precedes
> the metadata update
> ----------------------------------------------------------------------------------------------
>
> Key: FLINK-40362
> URL: https://issues.apache.org/jira/browse/FLINK-40362
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Kafka
> Affects Versions: kafka-3.4.0, kafka-4.0.1, kafka-5.0.0
> Reporter: Sylwester Lachiewicz
> Assignee: Sylwester Lachiewicz
> Priority: Major
> Labels: pull-request-available
>
> An idle reader (a subtask with no assigned splits) that receives the
> no-more-splits signal before the {{MetadataUpdateEvent}} never forwards that
> signal to the sub-readers created by the update.
> {{DynamicKafkaSourceReader.handleSourceEvents}} guards the re-notification
> with {{!pendingSplits.isEmpty()}}, which is false in exactly this case, so
> {{notifyNoMoreSplits()}} is never re-delivered. The reader then returns
> {{NOTHING_AVAILABLE}} indefinitely and a bounded job never finishes.
> Reproduced deterministically at unit level:
> {{DynamicKafkaSourceReaderTest#testIdleReaderFinishesWhenNoMoreSplitsArrivesBeforeMetadata}}
> calls {{notifyNoMoreSplits()}} before {{handleSourceEvents(metadata)}} and
> then polls for {{END_OF_INPUT}}. On main it fails with "expected:
> END_OF_INPUT but was: NOTHING_AVAILABLE"; with the fix it passes.
> Fix: re-deliver the no-more-splits signal after processing a metadata update
> regardless of whether pending splits exist. {{notifyNoMoreSplits()}} is
> idempotent and only fires when the signal has already arrived, so this adds
> no new cross-component traffic.
> This was originally suspected of causing {{DynamicKafkaSourceITTest}}
> {{testIdleReader}} hangs in CI, but that has not been reproduced locally
> (11/11 passes on unfixed main), so the ITCase link is unconfirmed.
> Related: FLINK-40094 and FLINK-39979 touch the same reader idleness area.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)