This is an automated email from the ASF dual-hosted git repository.

chetanm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 03639af  Mesos - expose config for setting heartbeatMaxFailures to 
reconnect after master failover (#4171)
03639af is described below

commit 03639af55b3bf3c0d0e4b5b2e349628f54d353b1
Author: tysonnorris <[email protected]>
AuthorDate: Wed Dec 12 09:38:01 2018 -0800

    Mesos - expose config for setting heartbeatMaxFailures to reconnect after 
master failover (#4171)
    
    Update to latest mesos-actor; expose config for setting 
heartbeatMaxFailures to reconnect after master failover
---
 common/scala/build.gradle                                             | 2 +-
 common/scala/src/main/resources/application.conf                      | 1 +
 .../scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala | 4 +++-
 .../core/containerpool/mesos/test/MesosContainerFactoryTest.scala     | 3 ++-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/common/scala/build.gradle b/common/scala/build.gradle
index f0d8fd7..14d4d08 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 60117ea..1f31d83 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 3120aa9..53a6543 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 5643fdc..0178bc8 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 =

Reply via email to