sv2000 commented on a change in pull request #2555: [GOBBLIN-683] Add azkaban 
client retry logic.
URL: https://github.com/apache/incubator-gobblin/pull/2555#discussion_r258336055
 
 

 ##########
 File path: 
gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java
 ##########
 @@ -88,19 +96,23 @@ protected AzkabanClient(String username,
                           String url,
                           long sessionExpireInMin,
                           CloseableHttpClient httpClient,
-                          SessionManager sessionManager)
+                          SessionManager sessionManager,
+                          ExecutorService executorService)
       throws AzkabanClientException {
     this.username = username;
     this.password = password;
     this.url = url;
     this.sessionExpireInMin = sessionExpireInMin;
     this.httpClient = httpClient;
     this.sessionManager = sessionManager;
+    this.executorService = executorService;
     this.initializeClient();
     this.initializeSessionManager();
+    this.intializeExecutorService();
     this.retryer = RetryerBuilder.<AzkabanClientStatus>newBuilder()
         .retryIfExceptionOfType(InvalidSessionException.class)
-        .withWaitStrategy(WaitStrategies.exponentialWait(10, TimeUnit.SECONDS))
+        .withAttemptTimeLimiter(AttemptTimeLimiters.fixedTimeLimit(10, 
TimeUnit.SECONDS, this.executorService))
+        .withWaitStrategy(WaitStrategies.exponentialWait(60, TimeUnit.SECONDS))
         .withStopStrategy(StopStrategies.stopAfterAttempt(5))
 
 Review comment:
   3 attempts should be sufficient I think. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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