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 2020/01/02 18:48:08 UTC

[GitHub] [openwhisk] tysonnorris commented on a change in pull request #4698: Add healthcheck for Invoker -> Action Container

tysonnorris commented on a change in pull request #4698: Add healthcheck for Invoker -> Action Container 
URL: https://github.com/apache/openwhisk/pull/4698#discussion_r362583976
 
 

 ##########
 File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
 ##########
 @@ -820,6 +907,98 @@ object ContainerProxy {
   }
 }
 
+object TCPPingClient {
+  def props(config: ContainerProxyHealthCheckConfig, remote: InetSocketAddress, replies: ActorRef) =
+    Props(new TCPPingClient(remote, replies, config))
+}
+
+class TCPPingClient(remote: InetSocketAddress, listener: ActorRef, config: ContainerProxyHealthCheckConfig)
+    extends Actor {
+  implicit val logging = new AkkaLogging(context.system.log)
+  import context.system
+  implicit val ec = context.system.dispatcher
+  implicit var healthPingTx = TransactionId.actionHealthPing
+
+  var scheduledPing: Option[Cancellable] = None
+  var failedCount = 0
+  var pingMarker: StartMarker = null
+  val tcp = IO(Tcp)
+  var resume: Option[Promise[Unit]] = None
+  val addressString = s"${remote.getHostString}:${remote.getPort}"
+  restartPing()
+
+  private def restartPing() = {
+    cancelPing() //just in case restart is called twice
+    scheduledPing = Some(
+      context.system.scheduler.schedule(config.checkPeriod, config.checkPeriod, self, HealthPingSend(false)))
 
 Review comment:
   I understand - I have disabled the checking between Ready and Pausing states, so checking only occurs:
   * between Started and Running
   * on first activation after Paused (this one is not a ping check, but an HTTP failure will cause activation to be rescheduled instead of failed)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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