GJL commented on a change in pull request #9794: [FLINK-14247][runtime] Use 
NoResourceAvailableException to wrap TimeoutException on slot allocation timeout
URL: https://github.com/apache/flink/pull/9794#discussion_r329617947
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/DefaultScheduler.java
 ##########
 @@ -362,12 +365,22 @@ private static void propagateIfNonNull(final Throwable 
throwable) {
                                        
.registerProducedPartitions(logicalSlot.getTaskManagerLocation(), 
sendScheduleOrUpdateConsumerMessage);
                                executionVertex.tryAssignResource(logicalSlot);
                        } else {
-                               handleTaskFailure(executionVertexId, throwable);
+                               handleTaskFailure(executionVertexId, 
maybeWrapWithNoResourceAvailableException(throwable));
                        }
                        return null;
                };
        }
 
+       private Throwable maybeWrapWithNoResourceAvailableException(final 
Throwable failure) {
+               final Throwable strippedThrowable = 
ExceptionUtils.stripCompletionException(failure);
+               if (strippedThrowable instanceof TimeoutException) {
+                       return new NoResourceAvailableException("Could not 
allocate the required slot within slot request timeout. " +
 
 Review comment:
   I see. It seems that currently all `TimeoutExceptions` caught here are 
thrown by the RPC framework. However, this is an implementation detail that 
could change over time. Therefore, I would still include the `failureCause`.

----------------------------------------------------------------
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

Reply via email to