mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
Cap concurrent proxy connections with a per-proxy semaphore, apply configurable handshake and backend-connect timeouts to both the client and backend sockets, and defer backend PostgreSQL connects until after client auth completes. Close leaked backend sockets defensively on every exit path, including a RuntimeException thrown between authenticate() returning a session and the bridge finishing its own cleanup, and bound backend-side reads during the handshake so a silent backend that accepts TCP but never answers cannot pin a handler thread and its connection permit forever. New EmulatorConfig keys under services.rds and services.redshift: proxy-handshake-timeout-millis (default 10000), proxy-backend-connect-timeout-millis (default 5000), proxy-max-connections (default 100).