slachiewicz opened a new pull request, #291:
URL: https://github.com/apache/flink-connector-kafka/pull/291

   ## What is the purpose of the change
   
   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, so the reader returns 
`NOTHING_AVAILABLE` indefinitely and a bounded job never finishes.
   
   ## Brief change log
   
   - `DynamicKafkaSourceReader.handleSourceEvents` guarded the no-more-splits 
re-notification with `!pendingSplits.isEmpty()`, which is false in exactly this 
case.
   - Re-deliver the 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 periodic or 
cross-component traffic — `MetadataUpdateEvent` itself is sent only on an 
actual metadata change, on reader registration, or via the deferred flush, not 
on the checkpoint interval.
   - Add 
`DynamicKafkaSourceReaderTest#testIdleReaderFinishesWhenNoMoreSplitsArrivesBeforeMetadata`.
   
   ## Verifying this change
   
   The new unit test fails on `main` with `expected: END_OF_INPUT but was: 
NOTHING_AVAILABLE` and passes with this change, on top of FLINK-40094.
   
   This was originally suspected of causing `DynamicKafkaSourceITTest` 
`testIdleReader` hangs in CI. That is **not** confirmed: `testIdleReader` 
passed 11/11 locally on unfixed `main` (JDK 21), so the ITCase link remains a 
suspicion and is recorded as such in FLINK-40362.
   
   This change was split out of #285, where it had been committed alongside an 
unrelated test-flakiness fix.
   
   ## Does this pull request potentially affect one of the following parts
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kafka connector, etc: yes, changes when 
`DynamicKafkaSourceReader` re-delivers the no-more-splits signal to sub-readers
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to