Juju 2.8 allows leadership code to run on non-leader
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Ian Booth |
Bug Description
I have a charm that has an explicit leadership test:
Nevertheless, I'm seeing a traceback related to attempting to set the pod spec while not a leader:
application-
application-
application-
application-
application-
Traceback (most recent call last):
File "lib/charms/
bus.
File "lib/charms/
_invoke(
File "lib/charms/
handler.
File "lib/charms/
self.
File "/var/lib/
layer.
File "lib/charms/
run_
File "lib/charms/
run([cmd], stdout=PIPE, stderr=PIPE, check=True, input=stdin.
File "/usr/lib/
raise CalledProcessEr
subprocess.
See this run for an example failure:
https:/
Changed in juju: | |
status: | Incomplete → Fix Committed |
Changed in juju: | |
milestone: | 2.8.6 → 2.8.7 |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
assignee: | Yang Kelvin Liu (kelvin.liu) → Ian Booth (wallyworld) |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
Initial thought, could be wrong....
If the current pod got terminated and a new pod spun up, it could be that the leadership changed between checking and doing to pod spec set operation. The newly created unit would grab leadership and the (now terminated) unit would lose it. So I think the charm may need to deal with this.