wsry commented on a change in pull request #15336:
URL: https://github.com/apache/flink/pull/15336#discussion_r599558320
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolTest.java
##########
@@ -515,6 +518,27 @@ public void testIsAvailableOrNot() throws
InterruptedException {
assertTrue(availableFuture2.isDone());
}
+ /** For FLINK-20547: https://issues.apache.org/jira/browse/FLINK-20547. */
+ @Test
+ public void testConsistentAvailability() throws Exception {
+ MemorySegment segment = null;
+ BufferPool localPool = null;
+ NetworkBufferPool globalPool = new TestNetworkBufferPool(numBuffers,
memorySegmentSize);
+ try {
+ localPool = new LocalBufferPool(globalPool, 1);
+ segment =
localPool.requestBufferBuilderBlocking().getMemorySegment();
+ localPool.setNumBuffers(2);
+ } finally {
+ if (segment != null) {
+ localPool.recycle(segment);
+ }
+ if (localPool != null) {
+ localPool.lazyDestroy();
+ }
+ globalPool.destroy();
+ }
Review comment:
I simplify the code without using CloseableRegistry.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]