From d0bbdd33448fe9532ebc47b39d3480310397496c Mon Sep 17 00:00:00 2001 From: Brendan Doyle Date: Tue, 13 Feb 2024 11:23:10 -0600 Subject: [PATCH 1/2] update FPC invoker health logic --- .../apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala index bf04d1d2a4d..5f2f37a544c 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala @@ -627,7 +627,7 @@ class FPCPoolBalancer(config: WhiskConfig, val missingHealths = if (healthsFromEtcd.isEmpty) Set.empty[InvokerHealth] else - ((0 to healthsFromEtcd.maxBy(_.id.toInt).id.toInt).toSet -- healthsFromEtcd.map(_.id.toInt)) + ((healthsFromEtcd.minBy(_.id.toInt).id.toInt to healthsFromEtcd.maxBy(_.id.toInt).id.toInt).toSet -- healthsFromEtcd.map(_.id.toInt)) .map(id => new InvokerHealth(InvokerInstanceId(id, Some(id.toString), userMemory = 0 MB), Offline)) (healthsFromEtcd ++ missingHealths) sortBy (_.id.toInt) } From 85df554171ec910aad15f0633b2733857291502b Mon Sep 17 00:00:00 2001 From: Brendan Doyle Date: Tue, 13 Feb 2024 11:50:42 -0600 Subject: [PATCH 2/2] fix scalafmt --- .../apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala index 5f2f37a544c..84bdc027f8f 100644 --- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala +++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala @@ -627,7 +627,10 @@ class FPCPoolBalancer(config: WhiskConfig, val missingHealths = if (healthsFromEtcd.isEmpty) Set.empty[InvokerHealth] else - ((healthsFromEtcd.minBy(_.id.toInt).id.toInt to healthsFromEtcd.maxBy(_.id.toInt).id.toInt).toSet -- healthsFromEtcd.map(_.id.toInt)) + ((healthsFromEtcd + .minBy(_.id.toInt) + .id + .toInt to healthsFromEtcd.maxBy(_.id.toInt).id.toInt).toSet -- healthsFromEtcd.map(_.id.toInt)) .map(id => new InvokerHealth(InvokerInstanceId(id, Some(id.toString), userMemory = 0 MB), Offline)) (healthsFromEtcd ++ missingHealths) sortBy (_.id.toInt) }