Raise HTTP WriteTimeout above the request middleware timeout (closes #62) #72
Reference in New Issue
Block a user
Delete Branch "issue-62-write-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raise
httpWriteTimeoutininternal/server/http.gofrom 10s to65 * time.Secondso it comfortably exceeds the router's 60srequestTimeout. This makes themiddleware.Timeout(60s)the effective request limit — a slow response now returns a clean 503 from the middleware instead of being cut at the socket write deadline by the transport.httpReadTimeoutstays at 10s. A comment onhttpWriteTimeoutdocuments that it must remain above the 60s request timeout. Change is confined tointernal/server/http.go;routes.gois untouched.Closes #62
Change summary
Single file changed:
internal/server/http.gohttpWriteTimeoutraised from10 * time.Secondto65 * time.SecondrequestTimeoutso the middleware timeout fires first and returns a clean 503httpReadTimeoutunchanged (10s);routes.gountouchedDiff:
Validation
docker build .(runs fmt-check, lint, test, build) exited 0:Independent review — PASS (merge-ready)
Adversarial review against the issue spec and repo policies.
internal/server/http.go:httpWriteTimeoutraised from 10s to 65s, above the router's 60srequestTimeout, somiddleware.Timeout(60s)fires first and returns a clean 503 instead of the transport cutting the response at the socket write deadline. Clear explanatory comment cross-referencingroutes.go.httpReadTimeoutleft at 10s.internal/server/http.go(+5/-2);routes.gountouched as instructed.docker build .green (fmt-check + lint + test + build). No AI/tooling references. Commit subject closes the issue.Verdict: meets the bar. Marking merge-ready and handing to @sneak for final review.