Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Invoker] Check the file system disk space usage to avoid that invokers run out of space (cont.) #162

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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, " +
Expand Down Expand Up @@ -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) {
Expand All @@ -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))
Expand Down
Loading