-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
runc update: cpu period and cpu burst being reset to defaults after an unrelated update #4225
Comments
|
AFAIK it does not make sense to set To aid in debugging, I have used this patch --- a/libcontainer/cgroups/systemd/v2.go
+++ b/libcontainer/cgroups/systemd/v2.go
@@ -278,6 +278,8 @@ func genV2ResourcesProperties(dirPath string, r *configs.Resources, cm *dbusConn
properties = append(properties, unifiedProps...)
}
+ logrus.Debugf("Properties: %+v", properties)
+
return properties, nil
}
Also, it makes sense to take a look at what systemd saves for the given unit: $ tail /run/systemd/transient/runc-test.scope.d/*
==> /run/systemd/transient/runc-test.scope.d/50-CPUQuota.conf <==
# This is a drop-in unit file extension, created via "systemctl set-property"
# or an equivalent operation. Do not edit.
[Scope]
CPUQuota=100%
==> /run/systemd/transient/runc-test.scope.d/50-CPUQuotaPeriodSec.conf <==
# This is a drop-in unit file extension, created via "systemctl set-property"
# or an equivalent operation. Do not edit.
[Scope]
CPUQuotaPeriodSec=900ms
... |
Maybe the solution to this issue is to disallow setting |
Perhaps commit 32746fb is doing what it should do. Looking... |
The problem is, with the current code it's impossible to distinguish between "unset" and "set to 0", thus the following code: Lines 294 to 298 in 18c313b
resets both quota and period. Something like this commit from #4142 should fix this, although it needs to be reworked. Stay tuned. |
Still, even with the fixed code, there is no way to know if period or quota were ever been set before. So, the best way to solve this is to require cpu-period and cpu-quota to be set together (and possibly break backward compatibility). The way to solve this without breaking backward compatibility is to assume period (or quota) is not set if it's I'll try to come up with a PR. |
Should be fixed in #4227 |
There's a similar bug for cpu-burst (it is reset to 0 after some unrelated |
The text was updated successfully, but these errors were encountered: