canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
48 stars 23 forks source link

`jhack lobotomy` #137

Closed PietroPasotti closed 3 months ago

PietroPasotti commented 4 months ago

lobotomy command. Helpful when you have to endure an event storm.

Idea: (temporary) disable event processing for a charm. Juju will know nothing, but the charm will ignore all events and be effectively dead.

Usage: image

image

Lobotomy replaces the dispatch script with one that does nothing except put a juju-log that says that the event has been skipped. Lobotomy can be applied and lifted in batches to whole applications o entire models.

benhoyt commented 4 months ago

Interesting idea! A couple of thoughts/questions:

PietroPasotti commented 4 months ago

storm

in some cases you know that you're about to get an event storm you don't want. For example, you want to remove a charm that has 100 relations, and you don't care about all those broken/departed events, you just want the charm to go.

A user came to me with a juju 2.9->3 migration scenario, where they needed to suspend event processing because model migration apparently involves breaking all cross-model relations and re-creating them on the new juju3 model. And they didn't want that to happen as you 'know' that the new model and the old one will be topologically identical and the events will effectively be for nothing and cause unnecessary workload restarts and downtime.