atproto relay in zig zlay.waow.tech
relay zig atproto

fix connect gate: release permit after connectAndRead, not at loop end master

the defer was scoped to the while loop body, holding the permit during backoff sleep (up to 30 min). if 50 hosts fail simultaneously, all permits lock for the backoff duration and no other host can connect. now releases the permit immediately after connectAndRead returns (success or failure). connected subscribers reading frames don't count against the handshake limit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


+16 -5
1 changed file