[
https://issues.apache.org/jira/browse/FLINK-7394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16179306#comment-16179306
]
ASF GitHub Bot commented on FLINK-7394:
---------------------------------------
Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/4499#discussion_r140831859
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannelTest.java
---
@@ -281,6 +286,73 @@ public void testProducerFailedException() throws
Exception {
ch.getNextBuffer();
}
+ /**
+ * Tests {@link RemoteInputChannel#recycle(MemorySegment)}, verifying
the exclusive segment is
+ * recycled to available buffers directly and it triggers notify of
announced credit.
+ */
+ @Test
+ public void testRecycleExclusiveBufferBeforeReleased() throws Exception
{
+ final SingleInputGate inputGate = mock(SingleInputGate.class);
+ final RemoteInputChannel inputChannel =
spy(createRemoteInputChannel(inputGate));
+
+ // Recycle exclusive segment
+
inputChannel.recycle(MemorySegmentFactory.getFactory().allocateUnpooledSegment(1024,
inputChannel));
+
+ assertEquals("There should have one available buffer after
recycle.",
--- End diff --
`There should be one buffer available after recycle`
> Manage exclusive buffers in RemoteInputChannel
> ----------------------------------------------
>
> Key: FLINK-7394
> URL: https://issues.apache.org/jira/browse/FLINK-7394
> Project: Flink
> Issue Type: Sub-task
> Components: Core
> Reporter: zhijiang
> Assignee: zhijiang
> Fix For: 1.4.0
>
>
> This is a part of work for credit-based network flow control.
> The basic works are:
> * Exclusive buffers are assigned to {{RemoteInputChannel}} after created by
> {{SingleInputGate}}.
> * {{RemoteInputChannel}} implements {{BufferRecycler}} interface to manage
> the exclusive buffers itself.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)