Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B888F200C0F for ; Thu, 2 Feb 2017 09:09:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B70DA160B61; Thu, 2 Feb 2017 08:09:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B24E4160B57 for ; Thu, 2 Feb 2017 09:09:03 +0100 (CET) Received: (qmail 25783 invoked by uid 500); 2 Feb 2017 08:09:02 -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 25770 invoked by uid 99); 2 Feb 2017 08:09:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 08:09:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A5271C0EBC for ; Thu, 2 Feb 2017 08:09:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hIHB74TzEI-3 for ; Thu, 2 Feb 2017 08:09:00 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1E51E5F30B for ; Thu, 2 Feb 2017 08:09:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id F22A9E03A2 for ; Thu, 2 Feb 2017 08:08:54 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E33E22527C for ; Thu, 2 Feb 2017 08:08:52 +0000 (UTC) Date: Thu, 2 Feb 2017 08:08:52 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4574) Strengthen fetch interval implementation in Kinesis consumer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Feb 2017 08:09:06 -0000 [ https://issues.apache.org/jira/browse/FLINK-4574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849627#comment-15849627 ] ASF GitHub Bot commented on FLINK-4574: --------------------------------------- Github user tzulitai commented on a diff in the pull request: https://github.com/apache/flink/pull/2925#discussion_r95132586 --- Diff: flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java --- @@ -88,6 +96,7 @@ protected ShardConsumer(KinesisDataFetcher fetcherRef, Integer subscribedShardStateIndex, KinesisStreamShard subscribedShard, SequenceNumber lastSequenceNum, + AtomicReference error, --- End diff -- I don't think you need to add this constructor argument here, because it isn't used in the tests, correct? This protected constructor exists for testing purposes. For example, in the tests, we mock a `KinesisProxyInterface` and inject it into a `ShardConsumer` under test through this constructor. On the other hand, it'll be good to add tests related to error handling across the new threads, in which case this constructor change can be left as is. > Strengthen fetch interval implementation in Kinesis consumer > ------------------------------------------------------------ > > Key: FLINK-4574 > URL: https://issues.apache.org/jira/browse/FLINK-4574 > Project: Flink > Issue Type: Improvement > Components: Kinesis Connector > Affects Versions: 1.1.0 > Reporter: Tzu-Li (Gordon) Tai > Assignee: Wei-Che Wei > > As pointed out by [~rmetzger], right now the fetch interval implementation in the {{ShardConsumer}} class of the Kinesis consumer can lead to much longer interval times than specified by the user, ex. say the specified fetch interval is {{f}}, it takes {{x}} to complete a {{getRecords()}} call, and {{y}} to complete processing the fetched records for emitting, than the actual interval between each fetch is actually {{f+x+y}}. > The main problem with this is that we can never guarantee how much time has past since the last {{getRecords}} call, thus can not guarantee that returned shard iterators will not have expired the next time we use them, even if we limit the user-given value for {{f}} to not be longer than the iterator expire time. > I propose to improve this by, per {{ShardConsumer}}, use a {{ScheduledExecutorService}} / {{Timer}} to do the fixed-interval fetching, and a separate blocking queue that collects the fetched records for emitting. -- This message was sent by Atlassian JIRA (v6.3.15#6346)