You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by pnowojski <gi...@git.apache.org> on 2017/11/23 16:18:51 UTC
[GitHub] flink pull request #4581: [FLINK-7499][io] fix double buffer release in Spil...
Github user pnowojski commented on a diff in the pull request:
https://github.com/apache/flink/pull/4581#discussion_r152826521
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionTest.java ---
@@ -300,6 +315,230 @@ public void testConsumeSpillablePartitionSpilledDuringConsume() throws Exception
assertTrue(buffer.isRecycled());
}
+ /**
+ * Tests {@link SpillableSubpartition#add(Buffer)} with a spillable finished partition.
+ */
+ @Test
+ public void testAddOnFinishedSpillablePartition() throws Exception {
+ SpillableSubpartition partition = createSubpartition();
+ partition.finish();
+
+ Buffer buffer = new Buffer(MemorySegmentFactory.allocateUnpooledSegment(4096),
+ FreeingBufferRecycler.INSTANCE);
+ try {
+ partition.add(buffer);
+ } finally {
--- End diff --
? Why does this test covers for both failure and normal paths? What if one of them never happen?
---