Skip to content

fix: add http server timeouts to prevent fd exhaustion - #33

Merged
boidushya merged 1 commit into
masterfrom
fix/server-timeouts-fd-leak
Jul 3, 2026
Merged

fix: add http server timeouts to prevent fd exhaustion#33
boidushya merged 1 commit into
masterfrom
fix/server-timeouts-fd-leak

Conversation

@boidushya

Copy link
Copy Markdown
Member

Overview

The server started with http.ListenAndServe, which has no connection timeouts, so idle and half-dead keep-alive connections were never closed. They leaked file descriptors over weeks until the process hit its 65k limit, stopped accepting connections, and took the whole API down. Gave the server explicit read, write, header, and idle timeouts so every connection has a bounded lifetime, and exempted the cache-db dump endpoint since it legitimately streams for longer. Added a file-descriptor monitor too, so the next slow climb pages through the notification channels at 80% of the limit instead of going dark at 100%.

@better-lyrics-harmonizer

better-lyrics-harmonizer Bot commented Jul 3, 2026

Copy link
Copy Markdown

Preview torn down

This PR's ephemeral environment was cleaned up.

Detail Value
Status Torn down
Branch fix/server-timeouts-fd-leak
Last commit a0db8fb
Closed 2026-07-03 13:16:12 UTC
Workflow run #28663028116

Reopen the PR if you need to spin it back up.

@boidushya
boidushya merged commit b0be234 into master Jul 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant