kpavel commented on a change in pull request #4082: Rename prewarmed containers
URL: 
https://github.com/apache/incubator-openwhisk/pull/4082#discussion_r230291428
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala
 ##########
 @@ -349,7 +362,15 @@ class ContainerProxy(
     // Only initialize iff we haven't yet warmed the container
     val initialize = stateData match {
       case data: WarmedData => Future.successful(None)
-      case _                => 
container.initialize(job.action.containerInitializer, 
actionTimeout).map(Some(_))
+      case _                =>
+        // check if container has generic "prewarm" name
+        if (isPrewarmed(container.name, instance, job.action.exec.kind)) {
+          // now rename container to action based name
+          val newName =
+            ContainerProxy.containerName(instance, 
job.msg.user.namespace.name.asString, job.action.name.asString)
+          container.rename(newName)
 
 Review comment:
   > Are the suspend and resume operations affected by a pending rename?
   According to docker daemon source code those operations are synchronized by 
container object. I don't see there any possible conflict. 
   From the OpenWhisk perspective, all container operations currently using 
container UID.

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