kl0u commented on a change in pull request #10069: [FLINK-14593][client] Port 
ClusterClient to asynchronous interface version
URL: https://github.com/apache/flink/pull/10069#discussion_r343010061
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java
 ##########
 @@ -704,17 +704,14 @@ private String triggerSavepoint(ClusterClient<?> 
clusterClient, JobID jobId, Str
                final String savepointPath;
 
                try {
-                       savepointPath = savepointPathFuture.get();
-               }
-               catch (Exception e) {
+                       savepointPath = 
savepointPathFuture.get(clientTimeout.toMillis(), TimeUnit.MILLISECONDS);
 
 Review comment:
   You can put everything in the `try - catch`block to avoid having 
non-initialized variables outside: 
   
   ```
   try {
                        final String savepointPath = 
savepointPathFuture.get(clientTimeout.toMillis(), TimeUnit.MILLISECONDS);
   
                        logAndSysout("Savepoint completed. Path: " + 
savepointPath);
                        logAndSysout("You can resume your program from this 
savepoint with the run command.");
   
                } catch (Exception e) {
                        Throwable cause = 
ExceptionUtils.stripExecutionException(e);
                        throw new FlinkException("Triggering a savepoint for 
the job " + jobId + " failed.", cause);
                }
   ```

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