zentol commented on a change in pull request #16881:
URL: https://github.com/apache/flink/pull/16881#discussion_r695151108
##########
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:
hmm :/
seems a bit overkill doesn't it. Maybe we should just focus on the happy
paths; we have the "Submitting job" at the start, and a log message once it is
successful, If it fails it is logged later anyway.
--
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]