[
https://issues.apache.org/jira/browse/FLINK-29324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anthony Pounds-Cornish updated FLINK-29324:
-------------------------------------------
Description:
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].
was:
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].
The fix should be 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].
> 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.15.2
> Reporter: Anthony Pounds-Cornish
> Priority: Major
>
> 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)