In TcpProxy._forward_loop(), the connection is removed from _connections before _close_pair() completes. Concurrent stop() or drop_connections() can therefore miss a still-running forwarder with open sockets, and active_connections briefly under-reports.
Keep the entry registered through socket cleanup and add a deterministic regression test.
Related: #948, #949.
In
TcpProxy._forward_loop(), the connection is removed from_connectionsbefore_close_pair()completes. Concurrentstop()ordrop_connections()can therefore miss a still-running forwarder with open sockets, andactive_connectionsbriefly under-reports.Keep the entry registered through socket cleanup and add a deterministic regression test.
Related: #948, #949.