xiaoyao1991 commented on a change in pull request #3187: Consolidate Packing
URL: https://github.com/apache/incubator-heron/pull/3187#discussion_r254085915
 
 

 ##########
 File path: 
heron/packing/src/java/org/apache/heron/packing/roundrobin/ResourceCompliantRRPacking.java
 ##########
 @@ -179,13 +135,18 @@ public PackingPlan pack() {
 
         return planBuilder.build();
 
-      } catch (ResourceExceededException e) {
+      } catch (ConstraintViolationException e) {
         //Not enough containers. Adjust the number of containers.
         LOG.finest(String.format(
             "%s Increasing the number of containers to %s and attempting to 
place again.",
             e.getMessage(), this.numContainers + 1));
         increaseNumContainers(1);
         resetToFirstContainer();
+
+        int totalInstances = TopologyUtils.getTotalInstance(topology);
+        if (numContainers > totalInstances) {
 
 Review comment:
   Yes, this is possible. The way RCRR works now is run in an `while(true)` 
loop and add containers one by one. Without this check here, the code could 
stuck in an infinite loop if the allocated container size cannot even fit 1 
instance

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