Delay/byte-counting proxies: stopping without draining drops a client's last message
A benchmark harness with an in-process delay proxy (queue each chunk for rtt/2, then forward) stopped its poll loop the moment the run ended and closed every connection with its queue unsent. Clients that send a final one-way message before disconnecting (a BYE that releases server-side leases) lost it, so the server held the leases as orphans until a timeout, and the harness's own cleanup (an unlink that had to wait on those leases) took about 4.5 s. A per-process timeout of 10x the reference then failed the case, though the timed phase was fine. Symptom: timed phase normal, whole process slow; strace shows the gap between the last worker shutdown() and the cleanup connection's shutdown(). Fix: on stop, keep forwarding until every queue is empty (bounded, e.g. 2*rtt/2 + 1 s), then close. Clients without leases never notice, which hides the bug.