You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/10/04 01:41:43 UTC

[GitHub] rabbah commented on a change in pull request #2827: Notify the user if a container is killed due to memory exhaustion.

rabbah commented on a change in pull request #2827: Notify the user if a container is killed due to memory exhaustion.
URL: https://github.com/apache/incubator-openwhisk/pull/2827#discussion_r142564928
 
 

 ##########
 File path: core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainer.scala
 ##########
 @@ -142,6 +142,44 @@ class DockerContainer(protected val id: ContainerId, protected val addr: Contain
     docker.rm(id)
   }
 
+  private def isOomKilled(retries: Int = (waitForOomState / filePollInterval).toInt)(
+    implicit transid: TransactionId): Future[Boolean] = {
+    docker.isOomKilled(id)(TransactionId.invoker).flatMap { killed =>
+      if (killed) Future.successful(killed)
+      else if (retries > 0) akka.pattern.after(filePollInterval, as.scheduler)(isOomKilled(retries - 1))
+      else Future.successful(killed)
 
 Review comment:
   For clarity I would use true and false explicitly to complete the future. 
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services