zhuzhurk commented on code in PR #19653:
URL: https://github.com/apache/flink/pull/19653#discussion_r886323585
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/JobMasterPartitionTrackerImpl.java:
##########
@@ -120,6 +125,26 @@ public Collection<ResultPartitionDeploymentDescriptor>
getAllTrackedPartitions()
return
partitionInfos.values().stream().map(PartitionInfo::getMetaInfo).collect(toList());
}
+ @Override
+ public void connectToResourceManager(ResourceManagerGateway
resourceManagerGateway) {
+ this.resourceManagerGateway = resourceManagerGateway;
+ }
+
+ @Override
+ public List<ShuffleDescriptor> getClusterPartitionShuffleDescriptors(
+ IntermediateDataSetID intermediateDataSetID) {
+ Preconditions.checkNotNull(
+ resourceManagerGateway, "JobMaster is not connected to
ResourceManager");
+ try {
+ return this.resourceManagerGateway
+
.getClusterPartitionsShuffleDescriptors(intermediateDataSetID)
+ .get();
+ } catch (InterruptedException | ExecutionException e) {
+ e.printStackTrace();
Review Comment:
`e.printStackTrace()` should be avoided.
Usually it should be a warning log with exception.
But I'm wondering why it is returning a fake result, instead of throwing out
the exception to trigger failures?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/CacheCorruptedException.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler;
+
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
+
+import java.util.List;
+
+/** Indicates some task fail to consume cached intermediate dataset. */
+public class CacheCorruptedException extends JobException {
Review Comment:
The name is clearly explaining itself. Maybe
`CachedIntermediateDataSetCorruptedException`?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/ExecutionFailureHandler.java:
##########
@@ -123,6 +130,32 @@ private FailureHandlingResult handleFailure(
globalFailure);
}
+ if (!globalFailure) {
+ try {
+ final SchedulingExecutionVertex failedVertex =
+ schedulingTopology.getVertex(failingExecutionVertexId);
+ if (cause instanceof PartitionException
+ &&
!failedVertex.getCacheIntermediateDataSetIds().isEmpty()) {
+ return FailureHandlingResult.unrecoverable(
+ failingExecutionVertexId,
+ new CacheCorruptedException(
+ "Fail to consume cache",
+ cause,
+
failedVertex.getCacheIntermediateDataSetIds()),
+ timestamp,
+ globalFailure);
+ } else if (cause instanceof CacheCorruptedException) {
Review Comment:
This translation can be avoided by annotating `CacheCorruptedException` with
`ThrowableType#NonRecoverableError`.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/ExecutionFailureHandler.java:
##########
@@ -123,6 +130,32 @@ private FailureHandlingResult handleFailure(
globalFailure);
}
+ if (!globalFailure) {
+ try {
+ final SchedulingExecutionVertex failedVertex =
+ schedulingTopology.getVertex(failingExecutionVertexId);
+ if (cause instanceof PartitionException
Review Comment:
Maybe we can just check whether the `ResultPartitionID` of the
`PartitionException` is a cached result partition. And translate it to a
`CacheIntermediateDataSetCorruptedException`. This should placed above
`isUnrecoverableError(...)` check.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/ExecutionFailureHandler.java:
##########
@@ -123,6 +130,32 @@ private FailureHandlingResult handleFailure(
globalFailure);
}
+ if (!globalFailure) {
+ try {
+ final SchedulingExecutionVertex failedVertex =
+ schedulingTopology.getVertex(failingExecutionVertexId);
+ if (cause instanceof PartitionException
Review Comment:
This is not correct because `PartitionException` can also happen when
reading from a non-cached result.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]