You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/12 08:22:05 UTC

[GitHub] [flink] TanYuxin-tyx commented on a change in pull request #17936: [FLINK-24954][network] Refresh read buffer request timeout on buffer recycling/requesting for sort-shuffle

TanYuxin-tyx commented on a change in pull request #17936:
URL: https://github.com/apache/flink/pull/17936#discussion_r782805436



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPoolTest.java
##########
@@ -98,6 +98,34 @@ public void testRecycle() throws Exception {
         assertEquals(bufferPool.getNumTotalBuffers(), bufferPool.getAvailableBuffers());
     }
 
+    @Test
+    public void testBufferOperationTimestampUpdated() throws Exception {
+        BatchShuffleReadBufferPool bufferPool = new BatchShuffleReadBufferPool(1024, 1024);
+        long oldTimestamp = bufferPool.getLastBufferOperationTimestamp();
+        List<MemorySegment> buffers = bufferPool.requestBuffers();
+        assertEquals(1, buffers.size());
+        long nowTimestamp = bufferPool.getLastBufferOperationTimestamp();
+        // The timestamp is updated when requesting buffers successfully
+        assertTrue(nowTimestamp > oldTimestamp);
+        assertEquals(nowTimestamp, bufferPool.getLastBufferOperationTimestamp());
+
+        oldTimestamp = nowTimestamp;
+        bufferPool.recycle(buffers);

Review comment:
       OK, Fixed it.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPoolTest.java
##########
@@ -98,6 +98,34 @@ public void testRecycle() throws Exception {
         assertEquals(bufferPool.getNumTotalBuffers(), bufferPool.getAvailableBuffers());
     }
 
+    @Test
+    public void testBufferOperationTimestampUpdated() throws Exception {
+        BatchShuffleReadBufferPool bufferPool = new BatchShuffleReadBufferPool(1024, 1024);
+        long oldTimestamp = bufferPool.getLastBufferOperationTimestamp();
+        List<MemorySegment> buffers = bufferPool.requestBuffers();

Review comment:
       OK, Fixed it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org