dmvk commented on a change in pull request #16881:
URL: https://github.com/apache/flink/pull/16881#discussion_r695158049



##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
##########
@@ -372,16 +374,55 @@ public void close() {
 
         final CompletableFuture<JobSubmitResponseBody> submissionFuture =
                 requestFuture.thenCompose(
-                        requestAndFileUploads ->
-                                sendRetriableRequest(
-                                        JobSubmitHeaders.getInstance(),
-                                        EmptyMessageParameters.getInstance(),
-                                        requestAndFileUploads.f0,
-                                        requestAndFileUploads.f1,
-                                        
isConnectionProblemOrServiceUnavailable()));
+                        requestAndFileUploads -> {
+                            LOG.info(
+                                    "Submitting job '{}' ({}).",
+                                    jobGraph.getName(),
+                                    jobGraph.getJobID());
+                            final int retryMaxAttempts =
+                                    
restClusterClientConfiguration.getRetryMaxAttempts();
+                            final long retryDelay = 
restClusterClientConfiguration.getRetryDelay();
+                            final AtomicInteger failedAttempts = new 
AtomicInteger(0);
+                            return sendRetriableRequest(
+                                    JobSubmitHeaders.getInstance(),
+                                    EmptyMessageParameters.getInstance(),
+                                    requestAndFileUploads.f0,
+                                    requestAndFileUploads.f1,
+                                    isConnectionProblemOrServiceUnavailable(),
+                                    (receiver, error) -> {
+                                        if (error != null) {
+                                            final int performedRetries =
+                                                    
failedAttempts.getAndIncrement();
+                                            if (performedRetries < 
retryMaxAttempts) {
+                                                LOG.warn(
+                                                        "Unable to submit job 
'{}' ({}) to '{}'. Scheduling retry [attempt={}, maxAttempts={}, delay={}ms].",

Review comment:
       I think as long as it adds any value for the user, I'd be OK with having 
bit more complexity here.
   
   So the main question is, can the user benefit from having more verbose 
logging in this case? IMO this can especially help with network related issues.
   
   WDYT?




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