A subordinate charm hook scheduled to run(but waiting for the principal charm hook to release the lock) goes to an error state after the principal charm hook triggers a reboot.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Bogdan Teleaga | ||
1.24 |
Fix Released
|
High
|
Bogdan Teleaga |
Bug Description
This scenario needs at least 3 charms:
- one principal and one subordinate charm
- a third charm that services the principal charm
A relation must exist between the principal and the third charm.
This issue happens only when the principal charm executes the relation hook triggered by the third charm(let's name this hook third-relation-
if third-relation-
This issue happens on Windows 2012 R2 with Juju versions 1.24 and 1.25.
summary: |
- A subordinate charm hook scheduled to run(but it is waiting for the - principal charm hook to release the lock) goes to an error state after - the principal charm triggers a reboot. + A subordinate charm hook scheduled to run(but waiting for the principal + charm hook to release the lock) goes to an error state after the + principal charm hook triggers a reboot. |
tags: | added: reboot subordinate |
tags: | added: windows |
Changed in juju-core: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 1.25.0 |
tags: | added: regression |
tags: | added: hooks |
Changed in juju-core: | |
assignee: | nobody → Gabriel Samfira (gabriel-samfira) |
Changed in juju-core: | |
assignee: | Gabriel Samfira (gabriel-samfira) → Bogdan Teleaga (bteleaga) |
status: | Triaged → In Progress |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
This I believe happens because of the way hooks are run. The hook run has been split up in 3 steps:
* prepare
* execute
* commit
During prepare, the state of the hook is written, but we only start locking for hook execution in the "execute" phase. So we can have one hook that requires a reboot executing, and another one finishing the prepare phase, ready to execute. If we reboot the machine, when the uniter comes back up, it will see the second hook in the preparing phase, but has no knowledge of this happening, and sets it in error state.
I think this can be fixed by simply locking in the prepare phase and unlocking after execute, instead of locking in execute.