You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(http): stop HTTPS connection-permit leak that silently killed TLS
The HTTPS accept loop bounds concurrency with a 1024-permit semaphore
and held each permit for the whole connection, but the only timeout was
a 30s cap on the TLS handshake -- nothing bounded an idle keep-alive or
slow-loris connection once established. Scanner and abandoned
connections accumulated until all 1024 permits were held, after which
try_acquire_owned() failed for every new connection and the loop
silently `continue`d, refusing it before the handshake. The result was a
total HTTPS outage -- connection resets, "no peer certificate available"
-- while the process, HTTP:80 and DNS all stayed healthy and the
container reported healthy, so nothing surfaced the failure.
- Add header_read_timeout so an idle or slow connection releases its
permit instead of pinning it; this is what stops the pool draining.
- Release the permit explicitly when serving completes. For a WebSocket,
serve_connection resolves at the with_upgrades() handoff and the socket
continues in its own task, so an established WebSocket no longer holds
one of the bounded HTTPS slots for its lifetime.
- Replace the silent drop on pool exhaustion with a rate-limited warning
(at most one line per 5s) so this condition can never again be
invisible.
0 commit comments