From f8b120d2b2e66a0bc8c3d7710b031e1848f13243 Mon Sep 17 00:00:00 2001 From: srost Date: Wed, 16 Aug 2023 17:03:59 +0200 Subject: [PATCH] [Invoker] Check the file system disk space usage to avoid that invokers run out of space (cont.) --- .../openwhisk/core/invoker/InvokerReactive.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala index e7c6ae53e22..f6766ac2267 100644 --- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala +++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala @@ -227,7 +227,8 @@ class InvokerReactive( private val rootfs = "/" private val logsfs = "/logs" - private val fspcentmax = 85 + private val rootfspcentmax = sys.env.getOrElse("ROOT_FS_MAX", "98").toInt + private val logfspcentmax = sys.env.getOrElse("LOG_FS_MAX", "98").toInt private var rootfspcent = 0 private var logsfspcent = 0 @@ -249,8 +250,8 @@ class InvokerReactive( logging.warn( this, s"invoker fs space: " + - s"'$rootfsraw ($rootfspcentraw($rootfspcent($fspcentmax)))', " + - s"'$logsfsraw ($logsfspcentraw($logsfspcent($fspcentmax)))', " + + s"'$rootfsraw ($rootfspcentraw($rootfspcent($rootfspcentmax)))', " + + s"'$logsfsraw ($logsfspcentraw($logsfspcent($logfspcentmax)))', " + s"invoker container pool: " + s"freePoolSize: ${poolState.free} containers, " + s"busyPoolSize: ${poolState.busy} containers, " + @@ -503,6 +504,7 @@ class InvokerReactive( } private val healthProducer = msgProvider.getProducer(config) + rootfspcentmax Scheduler.scheduleWaitAtMost(1.seconds)(() => { // ping only if monitor is ready when enabled if (!imageMonitorEnabled || imageMonitor.isReady) { @@ -512,7 +514,7 @@ class InvokerReactive( PingMessage( instance = instance, isBlacklisted = namespaceBlacklist.isBlacklisted(instance.displayedName.getOrElse("")), - hasDiskPressure = rootfspcent >= fspcentmax || logsfspcent >= fspcentmax, + hasDiskPressure = rootfspcent >= rootfspcentmax || logsfspcent >= logfspcentmax, rootfspcent = rootfspcent, logsfspcent = logsfspcent, running = poolState.busy + poolState.waiting))