I would appreciate it if you had a clear trace of events before you say "this code is broken".

If the `sender_drain` variable is nonzero, then you're guaranteed that there is a drainer who is active. While that drainer fails to exit while they're the only one left, they'll keep going and try again.