fix(server): bound origin http.Server writes to clear the zero-window wedge (RIG-1319) - #33
Open
rigel-mintaka wants to merge 1 commit into
Open
fix(server): bound origin http.Server writes to clear the zero-window wedge (RIG-1319)#33rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
… wedge (RIG-1319) Add a rolling per-response write-deadline guard to the woodpecker origin http.Server(s) so a slow or stuck client that stops reading (a zero-window wedge) can no longer orphan a connection forever. cmd/server: setupServerTimeouts applies ReadHeaderTimeout, WriteTimeout, and IdleTimeout to all four http.Server constructions; ReadTimeout is deliberately left zero (small bodies; agent log upload rides gRPC on :9000). server/api: writedeadline.go adds newResponseController (unwraps past gin so FlushError surfaces), extendWriteDeadline, and slowHandlerProgress — the seam that re-arms a rolling per-response deadline for handlers that legitimately outrun the server-wide WriteTimeout. SSE streams (stream.go) re-arm before each write and gain an absolute streamMaxDuration ceiling for ping-only streams; the queue long-poll, RepairAllRepos, and the login/user forge-paging handlers re-arm per unit of progress and abort with 499 when the client goes away. Co-authored-by: Matt Wilkinson <matt@rigel.build> Spec-impact: none (orion spec updated separately). Refs RIG-1319
rigel-mintaka
force-pushed
the
pipelines/rig-1319-origin-write-timeout
branch
from
August 30, 2026 17:15
b5a0247 to
7d75299
Compare
rigel-mintaka
marked this pull request as ready for review
August 30, 2026 17:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a rolling per-response write-deadline guard to the woodpecker origin
http.Server(s) so a slow or stuck client that stops reading (a zero-window
wedge) can no longer orphan a connection forever.
cmd/server: setupServerTimeouts applies ReadHeaderTimeout, WriteTimeout, and
IdleTimeout to all four http.Server constructions; ReadTimeout is deliberately
left zero (small bodies; agent log upload rides gRPC on :9000).
server/api: writedeadline.go adds newResponseController (unwraps past gin so
FlushError surfaces), extendWriteDeadline, and slowHandlerProgress — the seam
that re-arms a rolling per-response deadline for handlers that legitimately
outrun the server-wide WriteTimeout. SSE streams (stream.go) re-arm before each
write and gain an absolute streamMaxDuration ceiling for ping-only streams; the
queue long-poll, RepairAllRepos, and the login/user forge-paging handlers re-arm
per unit of progress and abort with 499 when the client goes away.
Co-authored-by: Matt Wilkinson matt@rigel.build
Spec-impact: none (orion spec updated separately). Refs RIG-1319