<name>_relation_departed is sometimes called randomly or skipped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Expired
|
High
|
Unassigned |
Bug Description
The problem is twofold:
1) randomly calling relation_departed:
When adding an additional unit, the existing unit had it's relation_departed hook triggered out of the blue, apparently when I added an extra unit. Here's what I've done:
# deploy initial unit (https-client/33):
$ juju deploy ./https-
Located local charm "https-client", revision 30
Deploying "https-client" from local charm "https-client", revision 30
# establish relation with lxd:
$ juju relate https-client lxd
# so far so good so let's add one more unit (https-client/34):
$ juju add-unit https-client
# check the juju logs:
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-lxd-21: 16:31:29 DEBUG unit.lxd/
unit-lxd-21: 16:31:29 DEBUG unit.lxd/
unit-lxd-21: 16:31:29 DEBUG unit.lxd/
unit-lxd-21: 16:31:29 DEBUG unit.lxd/
unit-lxd-21: 16:31:29 DEBUG unit.lxd/
unit-lxd-21: 16:31:29 INFO unit.lxd/
In the above, we see https-client/33's departed hook was called for no reason.
2) not calling relation_departed:
# after the unexpected departure of https-client/33, I added another unit (https-client/35):
$ juju add-unit https-client
# this one behaved fine (joined and didn't cause any disruption)
# now to break the relation:
$ juju remove-relation https-client lxd
# check the juju logs:
unit-lxd-21: 16:35:36 DEBUG unit.lxd/
unit-lxd-21: 16:35:36 DEBUG unit.lxd/
unit-lxd-21: 16:35:36 DEBUG unit.lxd/
unit-lxd-21: 16:35:36 DEBUG unit.lxd/
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-https-
unit-lxd-21: 16:35:51 DEBUG unit.lxd/
unit-lxd-21: 16:35:51 DEBUG unit.lxd/
unit-lxd-21: 16:35:51 DEBUG unit.lxd/
unit-lxd-21: 16:35:51 DEBUG unit.lxd/
unit-lxd-21: 16:35:51 DEBUG unit.lxd/
unit-lxd-21: 16:35:51 INFO unit.lxd/
In the above, none of the https-client units saw their relation_departed hook invoked, only their (non-existent) relation_broken hook. For some reason, the lxd unit received a relation_departed for https-client/34 (but no other).
Additional information:
$ juju --version
2.9.15-ubuntu-amd64
$ juju status --relations --color
Model Controller Cloud/Region Version SLA Timestamp
test overlord maas/default 2.9.14 unsupported 16:44:05Z
App Version Status Scale Charm Store Channel Rev OS Message
https-client active 3 https-client local 30 ubuntu
lxd active 1 lxd local 30 ubuntu
Unit Workload Agent Machine Public address Ports Message
https-client/33* active idle 68 2602:fc62:
https-client/34 active idle 69 2602:fc62:
https-client/35 active idle 72 2602:fc62:
lxd/21* active idle 57 2602:fc62:
Machine State DNS Inst id Series AZ Message
57 started 2602:fc62:
68 started 2602:fc62:
69 started 2602:fc62:
71 started 2602:fc62:
72 started 2602:fc62:
73 started 2602:fc62:
74 started 2602:fc62:
75 started 2602:fc62:
76 started 2602:fc62:
77 started 2602:fc62:
78 started 2602:fc62:
79 started 2602:fc62:
81 started 2602:fc62:
82 pending pending focal
Changed in juju: | |
milestone: | 2.9.17 → 2.9.18 |
Changed in juju: | |
assignee: | nobody → Ian Booth (wallyworld) |
Changed in juju: | |
milestone: | 2.9.18 → 2.9.19 |
Changed in juju: | |
milestone: | 2.9.19 → 2.9.20 |
Changed in juju: | |
milestone: | 2.9.20 → 2.9.21 |
Changed in juju: | |
milestone: | 2.9.21 → 2.9.22 |
Changed in juju: | |
milestone: | 2.9.22 → 2.9.23 |
Changed in juju: | |
milestone: | 2.9.23 → 2.9.24 |
Changed in juju: | |
milestone: | 2.9.24 → 2.9.25 |
Changed in juju: | |
milestone: | 2.9.25 → 2.9.26 |
Changed in juju: | |
milestone: | 2.9.26 → 2.9.27 |
Changed in juju: | |
milestone: | 2.9.27 → 2.9.28 |
Changed in juju: | |
milestone: | 2.9.28 → 2.9.29 |
Changed in juju: | |
milestone: | 2.9.29 → 2.9.30 |
Changed in juju: | |
importance: | Critical → High |
milestone: | 2.9.30 → 2.9-next |
Changed in juju: | |
milestone: | 2.9-next → none |
Certainly randomly running relation-departed when a unit hasn't actually been removed (and then not running it when the relation *is* removed) is a critical function. I can't say we've seen this elsewhere, but I'll dig and see if we can reproduce