The endpoint directory and the topology are meant to reflect the state of the bus/domain that is expected by the administrators of a bus, and not simply the current state of online containers.
This is justified for several reasons:
- they (directory and topology) should not behave differently if a container is down for maintenance or because of a problem
- leaving a topology is an administrative action and not simply the result of stopping a container (i.e., an admin should explicitly detach a container from a topology for it to be effective).
Hence, the only reason why we remove endpoints from the endpoint directory (apart from stopping a SU of course) and remove a container from a topology is the detachment of a container from said topology.
Another more technical reason is when a container is restarted in order to ensure coherence of the endpoint directory (see PETALSESBCONT-416).