cpu_range with reservation takes precedence

Bug #1993648 reported by Arif Ali
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-sysconfig
Fix Released
Undecided
Arif Ali

Bug Description

When specifying cpu_range, reservation, and migrating to the new options. Some people may forget to reset the cpu_range/reservaton value, this will take precedence over the new value

juju config cpu_range=1,2,3,4 reservation=affinity cpu-affinity-range=1,2

If the above command it run, the CPUAffinity will be set to 1,2,3,4 and not 1,2

~~~
--- lib_sysconfig.py.orig 2022-10-20 11:19:13.203798104 +0000
+++ lib_sysconfig.py 2022-10-20 11:20:13.752422277 +0000
@@ -192,7 +192,7 @@
     @property
     def cpu_affinity_range(self):
         """Return cpu-affinity-range config."""
- if self.reservation == "affinity" and self.cpu_range:
+ if self.charm_config["cpu-affinity-range"] == "" and self.reservation == "affinity" and self.cpu_range:
             return self.cpu_range
         return self.charm_config["cpu-affinity-range"]

@@ -218,7 +218,7 @@
     @property
     def isolcpus(self):
         """Return isolcpus config."""
- if self.reservation == "isolcpus" and self.cpu_range:
+ if self.charm_config["isolcpus"] == "" and self.reservation == "isolcpus" and self.cpu_range:
             return self.cpu_range
         return self.charm_config["isolcpus"]

~~

I suspect a change like above should do the trick, or something similar

The workaround, and ought to unset the cpu_range/reservation values

Tags: sts

Related branches

Arif Ali (arif-ali)
Changed in charm-sysconfig:
assignee: nobody → Arif Ali (arif-ali)
status: New → In Progress
Arif Ali (arif-ali)
Changed in charm-sysconfig:
status: In Progress → Fix Committed
Changed in charm-sysconfig:
milestone: none → 23.01
Changed in charm-sysconfig:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.