Charm did not get any events between stop and start
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Undecided
|
Unassigned |
Bug Description
While running a load test for COS Lite, a workloadless charm received a StopContainer (haven't figured out why yet).
As a result, a `stop` hook was followed by a `start` hook with nothing in between and nothing after.
$ juju debug-log -i unit-scrape-
unit-scrape-
unit-scrape-
unit-scrape-
unit-scrape-
unit-scrape-
$ juju show-status-log scrape-target/0
Time Type Status Message
06 Apr 2023 11:55:41-04:00 juju-unit allocating
06 Apr 2023 11:55:41-04:00 workload waiting installing agent
06 Apr 2023 11:56:26-04:00 workload waiting agent initializing
06 Apr 2023 11:56:30-04:00 workload maintenance installing charm software
06 Apr 2023 11:56:30-04:00 juju-unit executing running install hook
06 Apr 2023 11:56:32-04:00 juju-unit executing running metrics-
06 Apr 2023 11:56:34-04:00 juju-unit executing running leader-elected hook
06 Apr 2023 11:56:34-04:00 juju-unit executing running config-changed hook
06 Apr 2023 11:56:36-04:00 juju-unit executing running start hook
06 Apr 2023 11:56:37-04:00 juju-unit executing running metrics-
06 Apr 2023 11:56:38-04:00 juju-unit executing running metrics-
06 Apr 2023 11:57:16-04:00 juju-unit idle
06 Apr 2023 11:57:16-04:00 workload active
07 Apr 2023 07:00:36-04:00 workload maintenance stopping charm software
07 Apr 2023 07:00:36-04:00 juju-unit executing running stop hook
07 Apr 2023 07:00:43-04:00 juju-unit executing running start hook
07 Apr 2023 07:01:27-04:00 juju-unit idle
07 Apr 2023 07:01:27-04:00 workload maintenance
In contrast, when I kubectl delete the pod, I see the full upgrade sequence:
unit-scrape-
unit-scrape-
unit-scrape-
unit-scrape-
I noticed that a similar thing happened with a regular sidecar charm (grafana):
After StopContainer I only get pebble-ready:
$ juju debug-log -i unit-grafana-0 --replay | grep Emitting | grep -v "update_status" 0.juju- log Emitting Juju event litestream_ pebble_ ready. 0.juju- log Emitting Juju event grafana_ pebble_ ready. 0.juju- log Emitting Juju event litestream_ pebble_ ready. 0.juju- log Emitting Juju event grafana_ pebble_ ready. 0.juju- log Emitting Juju event litestream_ pebble_ ready.
unit-grafana-0: 23:00:45 DEBUG unit.grafana/
unit-grafana-0: 07:00:42 DEBUG unit.grafana/
unit-grafana-0: 07:00:52 DEBUG unit.grafana/
unit-grafana-0: 07:03:14 DEBUG unit.grafana/
unit-grafana-0: 07:03:23 DEBUG unit.grafana/