Repository navigation
Reclaim addresses of connect failures not attributable to the address. - #942
Conversation
|
Splitting these codes out of
On the allow-list question: keep the allow-list. Over-reclaiming is the risk here, and a deny-list would reclaim any future code by default. |
e551868 to
d96a06f
Compare
|
Thanks, reworked.
Kept the allow-list. |
|
Looks good. Concurrency now rests on definitive state (seeding_ set at start, cleared by stop_seed on the network strand), and time only throttles after completion, so it doesn't reopen the backlog concern. The count gate and the backoff address the trigger. No further changes from me. |
A local network interruption fails connects with
ENETUNREACH,ENETDOWN,EADDRNOTAVAIL,ENOLINKor, with the router gone,EHOSTUNREACH. All mapped toconnect_failed, and a failed connect has no socket, soreclaim(ec, socket)never restored the address and an interruption drained the pool. Requested in #924.This splits
net_unreachable,host_unreachableandconnection_refusedout ofconnect_failed. A connect that fails unreachable (or the socks counterparts) is restored only if every member of its batch failed as unreachable, implying a local outage, and only into free pool capacity; otherwise it is dropped as before. Members that drew no address are not counted.maybe_reclaimadds the unreachable codes andinsufficient_buffer, so a connected address that later stops with one is restored, andhandle_onerestores other socketlessmaybe_reclaimfailures.Tests cover the mappings and batches that are wholly unreachable, refused, connected, timed out, empty or near a full pool.
Not addressed: a refused or unresolvable socks proxy drops the target, and with the gateway gone a timeout often arrives before
EHOSTUNREACH, so such batches still drop.