fix(ploeg): bound request body reads and idle connections in ploegd #148

Merged
ryangr0 merged 1 commit from ryangr0/ploegd-http-timeouts into development 2026-10-03 00:22:27 +00:00 AGit
Owner

ploegd's HTTP server set only ReadHeaderTimeout. Webhook handlers cap the
body size but not the time it takes to arrive, so a client that trickles
its body could hold a connection on an unauthenticated route
indefinitely, and idle keep-alive connections were never reclaimed.

The server is now built by newHTTPServer with ReadTimeout 30s (headers
plus body; a 1 MiB webhook needs only ~35 KiB/s to arrive in time) and
IdleTimeout 120s. No route streams (no SSE, long poll or flushed
responses), but WriteTimeout stays unset because it also bounds handler
time and deploy checks and webhooks call out to forges and trackers.
Tests cover a slow-body client being disconnected within the read
budget and a 1 MiB webhook at normal speed succeeding.

ReadTimeout 30s (headers and body), IdleTimeout 120s, ReadHeaderTimeout stays 5s. No route streams, but WriteTimeout stays unset on purpose: in Go it also caps handler run time, and several handlers call forges and trackers.

Verified with mise run verify on the pinned toolchain (all gates passed).

Ticket: https://vikunja.webgrip.dev/tasks/1725

🤖 Generated with Claude Code

ploegd's HTTP server set only ReadHeaderTimeout. Webhook handlers cap the body size but not the time it takes to arrive, so a client that trickles its body could hold a connection on an unauthenticated route indefinitely, and idle keep-alive connections were never reclaimed. The server is now built by newHTTPServer with ReadTimeout 30s (headers plus body; a 1 MiB webhook needs only ~35 KiB/s to arrive in time) and IdleTimeout 120s. No route streams (no SSE, long poll or flushed responses), but WriteTimeout stays unset because it also bounds handler time and deploy checks and webhooks call out to forges and trackers. Tests cover a slow-body client being disconnected within the read budget and a 1 MiB webhook at normal speed succeeding. ReadTimeout 30s (headers and body), IdleTimeout 120s, ReadHeaderTimeout stays 5s. No route streams, but WriteTimeout stays unset on purpose: in Go it also caps handler run time, and several handlers call forges and trackers. Verified with `mise run verify` on the pinned toolchain (all gates passed). Ticket: https://vikunja.webgrip.dev/tasks/1725 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ploeg): bound request body reads and idle connections in ploegd
Some checks failed
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
fdb59cbe62
ploegd's HTTP server set only ReadHeaderTimeout. Webhook handlers cap the
body size but not the time it takes to arrive, so a client that trickles
its body could hold a connection on an unauthenticated route
indefinitely, and idle keep-alive connections were never reclaimed.

The server is now built by newHTTPServer with ReadTimeout 30s (headers
plus body; a 1 MiB webhook needs only ~35 KiB/s to arrive in time) and
IdleTimeout 120s. No route streams (no SSE, long poll or flushed
responses), but WriteTimeout stays unset because it also bounds handler
time and deploy checks and webhooks call out to forges and trackers.
Tests cover a slow-body client being disconnected within the read
budget and a 1 MiB webhook at normal speed succeeding.

VIK-1725

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 merged commit f34cb24f99 into development 2026-10-03 00:22:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webgrip/unfold!148
No description provided.