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 B5342200C74 for ; Sun, 14 May 2017 17:35:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B3D64160BA9; Sun, 14 May 2017 15:35:15 +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 03A51160BA6 for ; Sun, 14 May 2017 17:35:14 +0200 (CEST) Received: (qmail 75576 invoked by uid 500); 14 May 2017 15:35:14 -0000 Mailing-List: contact dev-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 dev@flink.apache.org Received: (qmail 75565 invoked by uid 99); 14 May 2017 15:35:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 May 2017 15:35:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8FD821AA2CE for ; Sun, 14 May 2017 15:35:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nGrfoO9xaWjD for ; Sun, 14 May 2017 15:35:12 +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 AC1145F343 for ; Sun, 14 May 2017 15:35:11 +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 ABDBDE0630 for ; Sun, 14 May 2017 15:35:05 +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 DF010242EF for ; Sun, 14 May 2017 15:35:04 +0000 (UTC) Date: Sun, 14 May 2017 15:35:04 +0000 (UTC) From: "Kostas Kloudas (JIRA)" To: dev@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (FLINK-6578) SharedBuffer creates self-loops when having elements with same value/timestamp. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 14 May 2017 15:35:15 -0000 Kostas Kloudas created FLINK-6578: ------------------------------------- Summary: SharedBuffer creates self-loops when having elements with same value/timestamp. Key: FLINK-6578 URL: https://issues.apache.org/jira/browse/FLINK-6578 Project: Flink Issue Type: Bug Components: CEP Affects Versions: 1.3.0 Reporter: Kostas Kloudas Assignee: Kostas Kloudas Fix For: 1.3.0 This is a test that fails with the current implementation due to the fact that the looping state accepts the two {{middleEvent1}} elements but the shared buffer cannot distinguish between them and gets trapped in an infinite loop leading to running out of memory. {code} @Test public void testEagerZeroOrMoreSameElement() { List> inputEvents = new ArrayList<>(); Event startEvent = new Event(40, "c", 1.0); Event middleEvent1 = new Event(41, "a", 2.0); Event middleEvent2 = new Event(42, "a", 3.0); Event middleEvent3 = new Event(43, "a", 4.0); Event end1 = new Event(44, "b", 5.0); inputEvents.add(new StreamRecord<>(startEvent, 1)); inputEvents.add(new StreamRecord<>(middleEvent1, 3)); inputEvents.add(new StreamRecord<>(middleEvent1, 3)); inputEvents.add(new StreamRecord<>(middleEvent1, 3)); inputEvents.add(new StreamRecord<>(middleEvent2, 4)); inputEvents.add(new StreamRecord<>(new Event(50, "d", 6.0), 5)); inputEvents.add(new StreamRecord<>(middleEvent3, 6)); inputEvents.add(new StreamRecord<>(middleEvent3, 6)); inputEvents.add(new StreamRecord<>(end1, 7)); Pattern pattern = Pattern.begin("start").where(new SimpleCondition() { private static final long serialVersionUID = 5726188262756267490L; @Override public boolean filter(Event value) throws Exception { return value.getName().equals("c"); } }).followedBy("middle").where(new SimpleCondition() { private static final long serialVersionUID = 5726188262756267490L; @Override public boolean filter(Event value) throws Exception { return value.getName().equals("a"); } }).oneOrMore().optional().followedBy("end1").where(new SimpleCondition() { private static final long serialVersionUID = 5726188262756267490L; @Override public boolean filter(Event value) throws Exception { return value.getName().equals("b"); } }); NFA nfa = NFACompiler.compile(pattern, Event.createTypeSerializer(), false); final List> resultingPatterns = feedNFA(inputEvents, nfa); compareMaps(resultingPatterns, Lists.>newArrayList( Lists.newArrayList(startEvent, middleEvent1, middleEvent1, middleEvent1, middleEvent2, middleEvent3, middleEvent3, end1), Lists.newArrayList(startEvent, middleEvent1, middleEvent1, middleEvent1, middleEvent2, middleEvent3, end1), Lists.newArrayList(startEvent, middleEvent1, middleEvent1, middleEvent1, middleEvent2, end1), Lists.newArrayList(startEvent, middleEvent1, middleEvent1, middleEvent1, end1), Lists.newArrayList(startEvent, middleEvent1, middleEvent1, end1), Lists.newArrayList(startEvent, middleEvent1, end1), Lists.newArrayList(startEvent, end1) )); } {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)