Raise httpWriteTimeout in internal/server/http.go from 10s to 65 * time.Second so it comfortably exceeds the router's 60s requestTimeout. This makes the middleware.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.
httpReadTimeout stays at 10s. A comment on httpWriteTimeout documents that it must remain above the 60s request timeout. Change is confined to internal/server/http.go; routes.go is untouched.
Raise `httpWriteTimeout` in `internal/server/http.go` from 10s to `65 * time.Second` so it comfortably exceeds the router's 60s `requestTimeout`. This makes the `middleware.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.
`httpReadTimeout` stays at 10s. A comment on `httpWriteTimeout` documents that it must remain above the 60s request timeout. Change is confined to `internal/server/http.go`; `routes.go` is untouched.
Closes #62
// httpWriteTimeout is the maximum duration before timing out
- // writes of the response.
- httpWriteTimeout = 10 * time.Second
+ // writes of the response. It must stay above the router's
+ // requestTimeout (60s, in routes.go) so the middleware timeout
+ // fires first and returns a clean 503, rather than the transport
+ // cutting the connection at the socket write deadline.
+ httpWriteTimeout = 65 * time.Second
docker build exit code: 0
#33 naming to docker.io/library/webhooker-issue62 done
### Change summary
Single file changed: `internal/server/http.go`
- `httpWriteTimeout` raised from `10 * time.Second` to `65 * time.Second`
- comment added explaining it must stay above the router's 60s `requestTimeout` so the middleware timeout fires first and returns a clean 503
- `httpReadTimeout` unchanged (10s); `routes.go` untouched
Diff:
```
// httpWriteTimeout is the maximum duration before timing out
- // writes of the response.
- httpWriteTimeout = 10 * time.Second
+ // writes of the response. It must stay above the router's
+ // requestTimeout (60s, in routes.go) so the middleware timeout
+ // fires first and returns a clean 503, rather than the transport
+ // cutting the connection at the socket write deadline.
+ httpWriteTimeout = 65 * time.Second
```
### Validation
`docker build .` (runs fmt-check, lint, test, build) exited 0:
```
docker build exit code: 0
#33 naming to docker.io/library/webhooker-issue62 done
```
Adversarial review against the issue spec and repo policies.
internal/server/http.go: httpWriteTimeout raised from 10s to 65s, above the router's 60s requestTimeout, so middleware.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-referencing routes.go. httpReadTimeout left at 10s.
Scope limited to internal/server/http.go (+5/-2); routes.go untouched as instructed. docker build . green (fmt-check + lint + test + build). No AI/tooling references. Commit subject closes the issue.
No new test required: HTTP-server timeout behaviour is not meaningfully unit-testable without flakiness, and the existing server tests pass under the build.
Verdict: meets the bar. Marking merge-ready and handing to @sneak for final review.
## Independent review — PASS (merge-ready)
Adversarial review against the issue spec and repo policies.
- `internal/server/http.go`: `httpWriteTimeout` raised from 10s to 65s, above the router's 60s `requestTimeout`, so `middleware.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-referencing `routes.go`. `httpReadTimeout` left at 10s.
- Scope limited to `internal/server/http.go` (+5/-2); `routes.go` untouched as instructed. `docker build .` green (fmt-check + lint + test + build). No AI/tooling references. Commit subject closes the issue.
- No new test required: HTTP-server timeout behaviour is not meaningfully unit-testable without flakiness, and the existing server tests pass under the build.
Verdict: meets the bar. Marking merge-ready and handing to @sneak for final review.
sneak
was assigned by clawbot2026-08-07 13:56:48 +02:00
sneak
merged commit 0c9c885d51 into main2026-08-07 13:58:29 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.