Files
jambonz-api-server/lib/utils
Dave HortonandClaude Opus 5.5 328087042f fix: release homer sockets when a pcap request is abandoned (#565)
The pcap route awaited homer with no timeout and no tie to the client
connection, then used stream.pipe(res). If the client gave up (nginx 499)
before homer answered, the homer response body was piped into a closed
response, pipe() detached without destroying it, and the unread body kept
its socket and buffers referenced by the global undici pool forever.

With homer slow, this leaked roughly one socket per abandoned request:
~1,300 open fds and +200 MB RSS per api-server worker within four hours.

- abort the homer auth and pcap fetches when the response closes or after 30s
- use stream.pipeline() so the homer stream is destroyed if the client leaves

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:04:33 -06:00
..
2023-07-28 12:04:40 -04:00
2023-09-12 12:25:06 -04:00