[ 
https://issues.apache.org/jira/browse/FLINK-20051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17228794#comment-17228794
 ] 

Stephan Ewen commented on FLINK-20051:
--------------------------------------

The problem is that an in-initialized record batch is returned when the reader 
is woken up to handle the split change.

This line is the problem: 
https://github.com/apache/flink/blob/0b3f15ee598aa2b55706a4c3a30e2e529ac8f651/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/KafkaPartitionSplitReader.java#L99

We need to add {{recordsBySplits.prepareForRead();}}.

I will push this fix with my next set of commits.

> SourceReaderTestBase.testAddSplitToExistingFetcher failed with 
> NullPointerException
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-20051
>                 URL: https://issues.apache.org/jira/browse/FLINK-20051
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Common
>    Affects Versions: 1.12.0
>            Reporter: Dian Fu
>            Assignee: Stephan Ewen
>            Priority: Critical
>              Labels: test-stability
>             Fix For: 1.12.0
>
>
> https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=9322&view=logs&j=4be4ed2b-549a-533d-aa33-09e28e360cc8&t=0db94045-2aa0-53fa-f444-0130d6933518
> {code}
> 2020-11-08T21:49:29.6792941Z [ERROR] 
> testAddSplitToExistingFetcher(org.apache.flink.connector.kafka.source.reader.KafkaSourceReaderTest)
>   Time elapsed: 0.632 s  <<< ERROR!
> 2020-11-08T21:49:29.6793408Z java.lang.NullPointerException
> 2020-11-08T21:49:29.6793998Z  at 
> org.apache.flink.connector.kafka.source.reader.KafkaPartitionSplitReader$KafkaPartitionSplitRecords.nextSplit(KafkaPartitionSplitReader.java:363)
> 2020-11-08T21:49:29.6795970Z  at 
> org.apache.flink.connector.base.source.reader.SourceReaderBase.moveToNextSplit(SourceReaderBase.java:187)
> 2020-11-08T21:49:29.6796596Z  at 
> org.apache.flink.connector.base.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:159)
> 2020-11-08T21:49:29.6797317Z  at 
> org.apache.flink.connector.base.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:116)
> 2020-11-08T21:49:29.6797942Z  at 
> org.apache.flink.connector.testutils.source.reader.SourceReaderTestBase.testAddSplitToExistingFetcher(SourceReaderTestBase.java:98)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to