Sanil15 commented on a change in pull request #1219: SAMZA-2373: Container 
Placement Service (core functionality) for container move and restart
URL: https://github.com/apache/samza/pull/1219#discussion_r348767357
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerAllocator.java
 ##########
 @@ -415,20 +407,34 @@ public void stop() {
 
 
   /**
-   * Checks if a request has expired.
+   * Checks if a request has expired. If this request is due to a control 
action, then expiry timeout can be overridden
+   * otherwise defaults to
+   *
    * @param request the request to check
    * @return true if request has expired
    */
   private boolean isRequestExpired(SamzaResourceRequest request) {
     long currTime = Instant.now().toEpochMilli();
-    boolean requestExpired =  currTime - 
request.getRequestTimestamp().toEpochMilli() > requestExpiryTimeout;
+    boolean requestExpired =  currTime - 
request.getRequestTimestamp().toEpochMilli() > getRequestTimeout(request);
     if (requestExpired) {
       LOG.info("Request for Processor ID: {} on host: {} with creation time: 
{} has expired at current time: {} after timeout: {} ms.",
           request.getProcessorId(), request.getPreferredHost(), 
request.getRequestTimestamp(), currTime, requestExpiryTimeout);
     }
     return requestExpired;
   }
 
+  /**
+   * Control actions like move, restarts can optionally override request 
expiry timeout. Otherwise it defaults to
+   * { @code requestExpiryTimeout }
+   */
+  private Long getRequestTimeout(SamzaResourceRequest request) {
+    Optional<Long> controlActionRequestExpirytimeout = 
containerManager.getActionExpiryTimeout(request.getProcessorId());
 
 Review comment:
   If the RM is not able to get back the requested resource in configured time 
which for most jobs remains 5 seconds, this will fail the control action. If it 
is desirable to wait longer the only way would be config change & rebounce of a 
job We don't have concrete benchmarking numbers on RM to determine a safe 
default so this ability is good to have?

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