"The system should not allow a loop to be introduced. Obviously. But, it happened, and it'll happen again given enough time, so what else?"<p>The algorithm to detect a cycle is pretty simple. Why not prevent them?<p><a href="https://en.m.wikipedia.org/wiki/Cycle_detection" rel="nofollow">https://en.m.wikipedia.org/wiki/Cycle_detection</a>
On a physical level, unbounded deadlines and unlimited resource constraints don't exist, so I've learned to distrust anything that assumes "it scales forever".<p>It's just a lot simpler to plan a static capacity target for each system resource, test and enforce around it, then review it when it falls over. Otherwise you get scenarios like this one, where the bug permeates the whole system and you get "dead allocations" that float in the ethereal void of the system's plumbing, where they are hardest to trace. Leaks can happen in all sorts of environments as soon as you start putting in some layers of indirection, whether it's UI listeners, memory allocations, processes, or whole computers in a network. The indirection is usually done with the intent of optimizing a near-term development goal, but it burdens every future goal with a thing to design for or design around.