markusthoemmes commented on a change in pull request #2802: Akka Usage Cleanup 
for Actor State safety
URL: 
https://github.com/apache/incubator-openwhisk/pull/2802#discussion_r144799933
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/ContainerPool.scala
 ##########
 @@ -115,26 +115,31 @@ class ContainerPool(childFactory: ActorRefFactory => 
ActorRef,
 
     // Container is free to take more work
     case NeedWork(data: WarmedData) =>
-      freePool.update(sender(), data)
-      busyPool.remove(sender()).foreach(_ => feed ! MessageFeed.Processed)
+      freePool = freePool + (sender() -> data)
+      busyPool = busyPool - sender()
+      busyPool.foreach { _ =>
+        feed ! MessageFeed.Processed
+      }
 
     // Container is prewarmed and ready to take work
     case NeedWork(data: PreWarmedData) =>
-      prewarmedPool.update(sender(), data)
+      prewarmedPool = prewarmedPool + (sender() -> data)
 
     // Container got removed
     case ContainerRemoved =>
-      freePool.remove(sender())
-      busyPool.remove(sender()).foreach(_ => feed ! MessageFeed.Processed)
+      freePool = freePool - sender()
+      busyPool = busyPool - sender()
+      busyPool.foreach { _ =>
+        feed ! MessageFeed.Processed
+      }
 
 Review comment:
   Same as above.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to