I am trying to signal to my charm when there are no more relations on the relation. Currently, I am emitting an event on ‘relation-broken’ if the number of relations are < 1. The event will never emit though, because even when the last application leaves the relation, the relation is still in the list of relations.
81 def _on_relation_broken(self, event): 82 """Emit slurmd_unavailable if there are no remaining relations.""" 83 if len(self.framework.model.relations['slurmd']) < 1: 84 self._state.slurmd_acquired = False 85 self.on.slurmd_unavailable.emit()
My findings are such that the relation is still in the relation data in the ‘relation-broken’ event. My question is, is this intended?