You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/19 10:16:10 UTC

[GitHub] [flink-kubernetes-operator] morhidi commented on a diff in pull request #225: [FLINK-27675] Improve manual savepoint tracking

morhidi commented on code in PR #225:
URL: https://github.com/apache/flink-kubernetes-operator/pull/225#discussion_r876878780


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/SavepointObserver.java:
##########
@@ -106,36 +117,36 @@ private Optional<String> observeTriggeredSavepointProgress(
             LOG.debug("Savepoint not in progress");
             return Optional.empty();
         }
-        LOG.info("Observing savepoint status");
-        SavepointFetchResult savepointFetchResult;
-        try {
-            savepointFetchResult =
-                    flinkService.fetchSavepointInfo(
-                            currentSavepointInfo.getTriggerId(), jobID, deployedConfig);
-        } catch (Exception e) {
-            LOG.error("Exception while fetching savepoint info", e);
-            return Optional.empty();
-        }
-
-        if (!savepointFetchResult.isTriggered()) {
-            String error = savepointFetchResult.getError();
-            if (error != null
-                    || SavepointUtils.gracePeriodEnded(
-                            configManager.getOperatorConfiguration(), currentSavepointInfo)) {
-                String errorMsg = error != null ? error : "Savepoint status unknown";
-                LOG.error(errorMsg);
+        LOG.info("Observing savepoint status.");
+        SavepointFetchResult savepointFetchResult =
+                flinkService.fetchSavepointInfo(
+                        currentSavepointInfo.getTriggerId(), jobID, deployedConfig);
+
+        if (savepointFetchResult.isPending()) {
+            if (SavepointUtils.gracePeriodEnded(
+                    configManager.getOperatorConfiguration(), currentSavepointInfo)) {
+                String errorMsg =
+                        "Savepoint triggering timed out after "
+                                + configManager
+                                        .getOperatorConfiguration()
+                                        .getSavepointTriggerGracePeriod();
                 currentSavepointInfo.resetTrigger();
+                LOG.error(errorMsg);
                 return Optional.of(errorMsg);
+            } else {
+                LOG.info("Savepoint operation not running yet, waiting within grace period...");

Review Comment:
   fixed



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org