tillrohrmann commented on a change in pull request #8242: [FLINK-6227][network]
Introduce the PartitionException for downstream task failure
URL: https://github.com/apache/flink/pull/8242#discussion_r285113017
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
##########
@@ -269,6 +270,24 @@ public void testProducerFailedException() throws
Exception {
ch.getNextBuffer();
}
+ /**
+ * Tests that {@link LocalInputChannel#requestSubpartition(int)} throws
{@link PartitionNotFoundException}
+ * if the result partition was not registered in {@link
ResultPartitionManager} before.
+ */
+ @Test
+ public void testPartitionNotFoundExceptionWhileRequestingPartition()
throws Exception {
+ final SingleInputGate inputGate = createSingleInputGate(1);
+ final LocalInputChannel localChannel =
createLocalInputChannel(inputGate, new ResultPartitionManager());
+
+ try {
+ localChannel.requestSubpartition(0);
+
+ fail("Should throw PartitionNotFoundException while
requesting unregistered partition.");
+ } catch (PartitionNotFoundException notFound) {
+ assertEquals(localChannel.getPartitionId(),
notFound.getPartitionId());
+ }
+ }
Review comment:
Maybe we could also check that the correct error is set if there is a small
backoff (e.g. `10 ms`) and no partition. This is a slightly different code path.
----------------------------------------------------------------
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]
With regards,
Apache Git Services