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

Danny Cranmer commented on FLINK-29324:
---------------------------------------

Thanks for the contribution [~xiaohei]

> Calling Kinesis connector close method before subtask starts running results 
> in NPE
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-29324
>                 URL: https://issues.apache.org/jira/browse/FLINK-29324
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Kinesis
>    Affects Versions: 1.14.5, 1.15.2
>            Reporter: Anthony Pounds-Cornish
>            Assignee: Dongming.Hu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.16.0, 1.17.0, 1.15.3
>
>
> When a Flink application is stopped before a Kinesis connector subtask has 
> been started, the following exception is thrown:
> {noformat}
> java.lang.NullPointerException
> at 
> org.apache.flink.streaming.connectors.kinesis.FlinkKinesisConsumer.close(FlinkKinesisConsumer.java:421)
> ...{noformat}
> This appears to be related to the fact that [fetcher 
> creation|https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisConsumer.java#L307]
>  may not occur by [the time it is referenced when the consumer is 
> closed|https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisConsumer.java#L421].
> A suggested fix is to make the {{close()}} method null safe [as it has been 
> in the {{cancel()}} 
> method|https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisConsumer.java#L407].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to