XComp commented on a change in pull request #17912:
URL: https://github.com/apache/flink/pull/17912#discussion_r758245035



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/savepoints/SavepointHandlers.java
##########
@@ -267,29 +278,48 @@ public SavepointStatusHandler(
             final AsynchronousJobOperationKey key = getOperationKey(request);
 
             return gateway.getTriggeredSavepointStatus(key)
-                    .thenApply(
-                            (operationResult) -> {
-                                switch (operationResult.getStatus()) {
-                                    case SUCCESS:
-                                        return 
AsynchronousOperationResult.completed(
-                                                operationResultResponse(
-                                                        
operationResult.getResult()));
-                                    case FAILURE:
-                                        return 
AsynchronousOperationResult.completed(
-                                                
exceptionalOperationResultResponse(
-                                                        
operationResult.getThrowable()));
-                                    case IN_PROGRESS:
-                                        return 
AsynchronousOperationResult.inProgress();
-                                    default:
-                                        throw new IllegalStateException(
-                                                "No handler for operation 
status "
-                                                        + 
operationResult.getStatus()
-                                                        + ", encountered for 
key "
-                                                        + key);
+                    .handle(
+                            (operationResult, throwable) -> {
+                                if (throwable == null) {
+                                    switch (operationResult.getStatus()) {
+                                        case SUCCESS:
+                                            return 
AsynchronousOperationResult.completed(
+                                                    operationResultResponse(
+                                                            
operationResult.getResult()));
+                                        case FAILURE:
+                                            return 
AsynchronousOperationResult.completed(
+                                                    
exceptionalOperationResultResponse(
+                                                            
operationResult.getThrowable()));
+                                        case IN_PROGRESS:
+                                            return 
AsynchronousOperationResult.inProgress();
+                                        default:
+                                            throw new IllegalStateException(
+                                                    "No handler for operation 
status "
+                                                            + 
operationResult.getStatus()
+                                                            + ", encountered 
for key "
+                                                            + key);
+                                    }
+                                } else {
+                                    maybeHandleUnknownOperation(throwable, 
key);

Review comment:
       True, I didn't check that `SavepointHandlerBase` is only used as a 
parent for the savepoint creation handlers. What you're saying makes sense...




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


Reply via email to