Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC9DD186F4 for ; Wed, 5 Aug 2015 11:48:04 +0000 (UTC) Received: (qmail 66957 invoked by uid 500); 5 Aug 2015 11:48:04 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 66895 invoked by uid 500); 5 Aug 2015 11:48:04 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 66878 invoked by uid 99); 5 Aug 2015 11:48:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2015 11:48:04 +0000 Date: Wed, 5 Aug 2015 11:48:04 +0000 (UTC) From: "Rico Bergmann (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-2325) PersistentKafkaSource throws ArrayIndexOutOfBoundsException if reading from a topic that is created after starting the Source MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14655238#comment-14655238 ] Rico Bergmann commented on FLINK-2325: -------------------------------------- I saw it. Just looked into the code. Seems that there will be the same problem since you initialise the lastOffsets Array before the topic is created ... > PersistentKafkaSource throws ArrayIndexOutOfBoundsException if reading from a topic that is created after starting the Source > ----------------------------------------------------------------------------------------------------------------------------- > > Key: FLINK-2325 > URL: https://issues.apache.org/jira/browse/FLINK-2325 > Project: Flink > Issue Type: Bug > Components: Kafka Connector > Affects Versions: 0.9 > Reporter: Rico Bergmann > Assignee: Robert Metzger > > I'm creating a PersistentKafkaSource reading from a specified topic from Kafka, that is at the time the PersistentKafkaSource is started (via open(.)) not yet present. That's why the number of partitions, that is read in the open(.) function is 0, which leads to arrays of length 0 (lastOffsets and committedOffsets). > May be it is better to check, whether numberOfPartitions returns 0 and if so, to take the default number of partitions from Kafka config? > Stacktrace: > java.lang.ArrayIndexOutOfBoundsException: 0 > at org.apache.flink.streaming.connectors.kafka.api.persistent.PersistentKafkaSource.run(PersistentKafkaSource.java:180) > at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:49) > at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.invoke(SourceStreamTask.java:55) > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:559) > at java.lang.Thread.run(Thread.java:745) -- This message was sent by Atlassian JIRA (v6.3.4#6332)