2024-06-22 13:25:31,304 ERROR tuned.units.manager: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tuned/units/manager.py", line 119, in _try_call
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/tuned/plugins/instance/instance.py", line 80, in apply_tuning
self._plugin.instance_apply_tuning(self)
File "/usr/lib/python3/dist-packages/tuned/plugins/base.py", line 266, in instance_apply_tuning
self._run_for_each_device(instance, self._instance_apply_dynamic, instance.assigned_devices)
File "/usr/lib/python3/dist-packages/tuned/plugins/base.py", line 207, in _run_for_each_device
callback(instance, device)
File "/usr/lib/python3/dist-packages/tuned/plugins/plugin_cpu.py", line 391, in _instance_apply_dynamic
self._instance_update_dynamic(instance, device)
File "/usr/lib/python3/dist-packages/tuned/plugins/plugin_cpu.py", line 399, in _instance_update_dynamic
if load < instance.options["load_threshold"]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'float' and 'str'
I have a custom profile with the following, used in a test case:
The load_threshold value is being read as a string, instead of a number/float. Am I using the wrong syntax?
It was patched like this in Ubuntu (patch by @lucaskanashiro):
--- a/tuned/plugins/plugin_cpu.py
+++ b/tuned/plugins/plugin_cpu.py
@@ -394,7 +394,7 @@ class CPULatencyPlugin(hotplug.Plugin):
return
load = instance._load_monitor.get_load()["system"]
- if load < instance.options["load_threshold"]:
+ if load < float(instance.options["load_threshold"]):
self._set_latency(instance.options["latency_high"])
else:
self._set_latency(instance.options["latency_low"])
But I was wondering if this shouldn't instead be fixed in whatever is reading the config file and populating instance.options. I'm poking around a bit, but thought I would open this bug too.
I have a custom profile with the following, used in a test case:
The
load_threshold
value is being read as a string, instead of a number/float. Am I using the wrong syntax?It was patched like this in Ubuntu (patch by @lucaskanashiro):
But I was wondering if this shouldn't instead be fixed in whatever is reading the config file and populating
instance.options
. I'm poking around a bit, but thought I would open this bug too.Reading up on ConfigParser, looks like there is no magic conversion going on.