mirror of
https://github.com/wweir/sower.git
synced 2026-10-20 00:15:34 +00:00
sowerd was OOM-killed on kr with 970 MiB anon-rss on a 1.6 GiB host: a connection burst in one window ballooned the heap and never came back. Three unbounded holds made that possible, all on paths the log does not show: - the :80 listener had no timeouts, so a connection that never finished a request kept a goroutine, a socket and its buffers for as long as the peer stayed connected; - the :443 accept loop had no concurrency cap, so resident memory grew with the arrival rate (a failed handshake returns silently); - relay.Relay only arms read deadlines, so a peer that stopped reading blocked its writer forever, leaking the connection pair, its goroutines and its descriptors (and the relay conn log never fired, because the call never returned). Arm a write deadline per write below the TLS listener, cap served connections, set every plain-HTTP timeout, and dump a heap profile on SIGUSR1 so the next occurrence can be attributed to an allocation site. Evidence and the open questions (the trigger is still unproven, and r6c's sower client shows a different, fd-independent growth) are recorded in docs/plans/2026-10-12-sowerd-connection-bounds.md.