jeremiaswerner closed pull request #3040: Adjust controller side action
time-out to avoid invokers marked as unhealthy
URL: https://github.com/apache/incubator-openwhisk/pull/3040
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/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
b/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
index be3bb0b09e..5be950df3d 100644
---
a/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
+++
b/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
@@ -44,17 +44,10 @@ import whisk.core.connector.MessageFeed
import whisk.core.connector.MessageProducer
import whisk.core.connector.MessagingProvider
import whisk.core.database.NoDocumentException
-import whisk.core.entity.{ActivationId, WhiskActivation}
-import whisk.core.entity.EntityName
-import whisk.core.entity.ExecutableWhiskActionMetaData
-import whisk.core.entity.Identity
-import whisk.core.entity.InstanceId
-import whisk.core.entity.UUID
-import whisk.core.entity.WhiskAction
+import whisk.core.entity._
import whisk.core.entity.size._
import whisk.core.entity.types.EntityStore
import whisk.spi.SpiLoader
-
import pureconfig._
case class LoadbalancerConfig(blackboxFraction: Double, invokerBusyThreshold:
Int)
@@ -185,11 +178,14 @@ class LoadBalancerService(config: WhiskConfig, instance:
InstanceId, entityStore
namespaceId: UUID,
invokerName: InstanceId,
transid: TransactionId): ActivationEntry = {
- val timeout = action.limits.timeout.duration + activeAckTimeoutGrace
+ val timeout = (action.limits.timeout.duration
+ .max(TimeLimit.STD_DURATION) * config.controllerInstances.toInt) +
activeAckTimeoutGrace
// Install a timeout handler for the catastrophic case where an active ack
is not received at all
// (because say an invoker is down completely, or the connection to the
message bus is disrupted) or when
// the active ack is significantly delayed (possibly dues to long queues
but the subject should not be penalized);
// in this case, if the activation handler is still registered, remove it
and update the books.
+ // in case of missing synchronization between n controllers in HA
configuration the invoker queue can be overloaded
+ // n-1 times and the maximal time for answering with active ack can be n
times the action time (plus some overhead)
loadBalancerData.putActivation(activationId, {
actorSystem.scheduler.scheduleOnce(timeout) {
processCompletion(Left(activationId), transid, forced = true, invoker
= invokerName)
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services