removing a machine doesn't always trigger relation-departed hooks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Undecided
|
Unassigned |
Bug Description
After force removing a machine, Juju didn't call relation-departed hooks.
Initially, `juju status --relations` looked like this:
Model Controller Cloud/Region Version SLA Timestamp
test overlord maas/default 2.9.15 unsupported 20:22:47Z
App Version Status Scale Charm Store Channel Rev OS Message
lxd active 3 lxd local 31 ubuntu
Unit Workload Agent Machine Public address Ports Message
lxd/81 active idle 99 2602:fc62:
lxd/82 active idle 101 2602:fc62:
lxd/83* active idle 102 2602:fc62:
Machine State DNS Inst id Series AZ Message
96 started 2602:fc62:
99 started 2602:fc62:
101 started 2602:fc62:
102 started 2602:fc62:
104 started 2602:fc62:
105 started 2602:fc62:
106 started 2602:fc62:
107 started 2602:fc62:
108 started 2602:fc62:
109 started 2602:fc62:
110 started 2602:fc62:
111 started 2602:fc62:
112 started 2602:fc62:
113 started 2602:fc62:
114 started 2602:fc62:
Then I removed the leader (lxd/83):
$ juju remove-machine --force 102
removing machine 102
- will remove unit lxd/83
Normally, this operation is visible in the logs as "Emitting Juju event cluster_
remove-machine --force is explicitly stating "don't worry about running any of the hooks, I am forcibly removing the machine". I believe it makes an attempt to run some, but if they take too long, it skips them. If you want the hooks to always be run, then you shouldn't be using --force.