You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/08/23 09:49:47 UTC

[GitHub] markusthoemmes commented on a change in pull request #3976: close connections and reset pool on Container.pause

markusthoemmes commented on a change in pull request #3976: close connections and reset pool on Container.pause
URL: https://github.com/apache/incubator-openwhisk/pull/3976#discussion_r212247196
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/containerpool/Container.scala
 ##########
 @@ -70,7 +70,10 @@ trait Container {
   protected var httpConnection: Option[ContainerClient] = None
 
   /** Stops the container from consuming CPU cycles. */
-  def suspend()(implicit transid: TransactionId): Future[Unit]
+  def suspend()(implicit transid: TransactionId): Future[Unit] = {
+    //close connection and reset the connection pool
+    closeConnections().andThen { case _ => httpConnection = None }
 
 Review comment:
   I think this should set `httpConnection = None` before running `closeConnections`. Otherwise you might get connections running on a closing client when you unpause directly.

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