flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7499) double buffer release in SpillableSubpartitionView
Date Thu, 23 Nov 2017 16:40:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-7499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264579#comment-16264579
] 

ASF GitHub Bot commented on FLINK-7499:
---------------------------------------

Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4581#discussion_r152842686
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartition.java
---
    @@ -95,20 +95,23 @@ public boolean add(Buffer buffer) throws IOException {
     				return false;
     			}
     
    -			// The number of buffers are needed later when creating
    -			// the read views. If you ever remove this line here,
    -			// make sure to still count the number of buffers.
    -			updateStatistics(buffer);
    -
     			if (spillWriter == null) {
     				buffers.add(buffer);
    +				// The number of buffers are needed later when creating
    +				// the read views. If you ever remove this line here,
    +				// make sure to still count the number of buffers.
    --- End diff --
    
    yes, all my new tests verify these numbers via
    ```
    assertEquals(..., partition.getTotalNumberOfBuffers());
    assertEquals(..., partition.getTotalNumberOfBytes());
    ```
    but I'll add some more of those checks to some existing tests


> 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)

Mime
View raw message