chetanmeh closed pull request #4171: mesos - expose config for setting heartbeatMaxFailures to reconnect after master failover URL: https://github.com/apache/incubator-openwhisk/pull/4171
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/common/scala/build.gradle b/common/scala/build.gradle index f0d8fd7138..14d4d08d97 100644 --- a/common/scala/build.gradle +++ b/common/scala/build.gradle @@ -67,7 +67,7 @@ dependencies { compile 'io.kamon:kamon-core_2.12:0.6.7' compile 'io.kamon:kamon-statsd_2.12:0.6.7' //for mesos - compile 'com.adobe.api.platform.runtime:mesos-actor:0.0.14' + compile 'com.adobe.api.platform.runtime:mesos-actor:0.0.15' //tracing support compile 'io.opentracing:opentracing-api:0.31.0' diff --git a/common/scala/src/main/resources/application.conf b/common/scala/src/main/resources/application.conf index 60117ea2be..1f31d83cd0 100644 --- a/common/scala/src/main/resources/application.conf +++ b/common/scala/src/main/resources/application.conf @@ -249,6 +249,7 @@ whisk { constraint-delimiter = " "//used to parse constraint strings teardown-on-exit = true //set to true to disable the mesos framework on system exit; set for false for HA deployments offer-refuse-duration = 5 seconds //minimum time until an offer will arrive again at a particular invoker + heartbeat-max-failures = 2 //number of missed heartbeats from mesos master until resubscribe timeouts { failover = 0 seconds //Timeout allowed for framework to reconnect after disconnection. task-launch = 45 seconds //timeout for creating mesos tasks (containers) diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala index 3120aa9c7a..53a6543a70 100644 --- a/common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala +++ b/common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala @@ -82,6 +82,7 @@ case class MesosConfig(masterUrl: String, teardownOnExit: Boolean, healthCheck: Option[MesosContainerHealthCheckConfig], offerRefuseDuration: FiniteDuration, + heartbeatMaxFailures: Int, timeouts: MesosTimeoutConfig) {} class MesosContainerFactory(config: WhiskConfig, @@ -198,7 +199,8 @@ object MesosContainerFactory { mesosConfig.role, mesosConfig.timeouts.failover, taskStore = new LocalTaskStore, - refuseSeconds = mesosConfig.offerRefuseDuration.toSeconds.toDouble)) + refuseSeconds = mesosConfig.offerRefuseDuration.toSeconds.toDouble, + heartbeatMaxFailures = mesosConfig.heartbeatMaxFailures)) val counter = new Counter() val startTime = Instant.now.getEpochSecond diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/mesos/test/MesosContainerFactoryTest.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/mesos/test/MesosContainerFactoryTest.scala index 5643fdc58a..0178bc8522 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/mesos/test/MesosContainerFactoryTest.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/mesos/test/MesosContainerFactoryTest.scala @@ -95,7 +95,7 @@ class MesosContainerFactoryTest val timeouts = MesosTimeoutConfig(1.seconds, 1.seconds, 1.seconds, 1.seconds, 1.seconds) val mesosConfig = - MesosConfig("http://master:5050", None, "*", true, Seq.empty, " ", Seq.empty, true, None, 1.seconds, timeouts) + MesosConfig("http://master:5050", None, "*", true, Seq.empty, " ", Seq.empty, true, None, 1.seconds, 2, timeouts) behavior of "MesosContainerFactory" @@ -125,6 +125,7 @@ class MesosContainerFactoryTest true, None, 1.seconds, + 2, timeouts) val factory = ---------------------------------------------------------------- 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