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 AB7C5200D2B for ; Thu, 2 Nov 2017 14:53:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AA1EC1609EE; Thu, 2 Nov 2017 13:53:11 +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 0586D160BFB for ; Thu, 2 Nov 2017 14:53:10 +0100 (CET) Received: (qmail 70113 invoked by uid 500); 2 Nov 2017 13:53:10 -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 70104 invoked by uid 99); 2 Nov 2017 13:53:10 -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; Thu, 02 Nov 2017 13:53:10 +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 500B91A4B5D for ; Thu, 2 Nov 2017 13:53:08 +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-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id TYtoJd6_oUzl for ; Thu, 2 Nov 2017 13:53:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4780E61170 for ; Thu, 2 Nov 2017 13:53:07 +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 04EA8E2567 for ; Thu, 2 Nov 2017 13:53:06 +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 40D2D2416E for ; Thu, 2 Nov 2017 13:53:03 +0000 (UTC) Date: Thu, 2 Nov 2017 13:53:03 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-7499) double buffer release in SpillableSubpartitionView MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Nov 2017 13:53:11 -0000 [ https://issues.apache.org/jira/browse/FLINK-7499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16235764#comment-16235764 ] ASF GitHub Bot commented on FLINK-7499: --------------------------------------- Github user pnowojski commented on a diff in the pull request: https://github.com/apache/flink/pull/4581#discussion_r148531416 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionView.java --- @@ -108,11 +108,7 @@ int releaseMemory() throws IOException { for (int i = 0; i < numBuffers; i++) { Buffer buffer = buffers.remove(); spilledBytes += buffer.getSize(); - try { - spillWriter.writeBlock(buffer); - } finally { - buffer.recycle(); - } + spillWriter.writeBlock(buffer); --- End diff -- Here is the place where you depend on recycling which is not guaranteed by `spillWriter`'s interface. > double buffer release in SpillableSubpartitionView > -------------------------------------------------- > > Key: FLINK-7499 > URL: https://issues.apache.org/jira/browse/FLINK-7499 > Project: Flink > Issue Type: Sub-task > Components: Network > Affects Versions: 1.2.0, 1.1.4, 1.3.0, 1.1.5, 1.2.1, 1.2.2, 1.3.1, 1.4.0, 1.3.2, 1.3.3 > Reporter: Nico Kruber > Assignee: Nico Kruber > Priority: Blocker > > {{SpillableSubpartitionView#releaseMemory()}} recycles its buffers twice: once asynchronously after the write operation and once in {{SpillableSubpartitionView#releaseMemory()}} after adding the write operation to the queue. > 1) if {{SpillableSubpartitionView#releaseMemory()}} hits first and the buffer is recycled, the memory region may already be reused despite the pending write > 2) If, for some reason (probably only in tests like {{SpillableSubpartitionTest#testConsumeSpillablePartitionSpilledDuringConsume()}}?), the buffer is retained and to be used in parallel somewhere else it may also not be available anymore or contain corrupt data. -- This message was sent by Atlassian JIRA (v6.4.14#64029)