rmatharu commented on a change in pull request #1296: SAMZA-2475: Add a 
allocated resource expiry timeout in samza yarn type of apps
URL: https://github.com/apache/samza/pull/1296#discussion_r385886995
 
 

 ##########
 File path: 
samza-yarn/src/main/java/org/apache/samza/job/yarn/YarnClusterResourceManager.java
 ##########
 @@ -575,6 +576,15 @@ public void onStopContainerError(ContainerId containerId, 
Throwable t) {
     }
   }
 
+  @Override
+  public boolean isResourceExpired(SamzaResource resource) {
+    /**
+     * Time from which resource was allocated + 1 min (to account for clock 
skew) > Yarn Expiry Timeout
+     */
+    return System.currentTimeMillis() - resource.getTimestamp() + 
Duration.ofMinutes(1).toMillis()
+        > YarnConfiguration.DEFAULT_RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS;
 
 Review comment:
   Could DEFAULT_RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS be a Duration?
   
   Duration.between(resource.getTS, 
Instant.now()).compareTo(DEFAULT_RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS) > 0;
   

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