zentol commented on a change in pull request #17912:
URL: https://github.com/apache/flink/pull/17912#discussion_r758238801
##########
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:
Why would we handle it in SavepointHandlerBase#triggerOperation? How
could it return an UnknownOperationKeyException, when the very purpose of it is
to trigger new operations?
--
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]