flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NicoK <...@git.apache.org>
Subject [GitHub] flink pull request #4581: [FLINK-7499][io] also let AsynchronousBufferFileWr...
Date Tue, 21 Nov 2017 17:11:30 GMT
Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4581#discussion_r152342531
  
    --- 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 --
    
    Actually, if I see this correctly, here the original code is wrong since it is already
recycling a buffer which was added to an asynchronous file write operation. This would lead
to data corruption if the buffer is re-used in the meanwhile, wouldn't it?!


---

Mime
View raw message