markusthoemmes commented on a change in pull request #3132: Separate container 
removal from job completion.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3132#discussion_r159216230
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/ContainerPool.scala
 ##########
 @@ -131,8 +138,21 @@ class ContainerPool(childFactory: ActorRefFactory => 
ActorRef,
       freePool = freePool - sender()
       busyPool.get(sender()).foreach { _ =>
         busyPool = busyPool - sender()
+        // container was busy, so there is capacity to accept another job 
request
         feed ! MessageFeed.Processed
       }
+
+    // This message is received either because:
+    // Container errored while to resume a warm container, could not process 
the job, and sent the job back
+    // The container aged, is destroying itself, and was assigned a job which 
it had to send back
+    // The container aged and is destroying itself
+    case JobRescheduled =>
+      freePool = freePool - sender()
+      busyPool.get(sender()).foreach { _ =>
+        // even though container was busy, no message is sent to the feed 
since there is no change in capacity yet
+        // (job still needs to be processed)
+        busyPool = busyPool - sender()
+      }
 
 Review comment:
   You can just go with: `busyPool = busyPool - sender()` here, since you don't 
need the handle on "if the element existed do xyz"

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