Skip to content

[upstream handoff] fix: apply a request timeout to every forge HTTP client - #9

Draft
rigelbuild-bot wants to merge 1 commit into
upstream-vcs/upstream-base-v0.5.4from
upstream-vcs/upstream-forge-timeout
Draft

rigelbuild-bot wants to merge 1 commit into
upstream-vcs/upstream-base-v0.5.4from
upstream-vcs/upstream-forge-timeout

Conversation

@rigelbuild-bot

Copy link
Copy Markdown

This branch is based on upstream v0.5.4 (0c03418), not on this fork's main. Matt pulls it and pushes it to the upstream Codeberg repo (codeberg.org/abrenneke/jj-vine). The two sections below are the text to open the upstream PR with; they are the deliverable, not this fork PR's own description.

Upstream PR title

fix: apply a request timeout to every forge HTTP client

Upstream PR description

reqwest applies no request timeout by default. A forge that accepts the TCP connection but never sends a response leaves the client blocked in the socket read indefinitely, with no output and no way out but an external kill. The GitHub, GitLab, Forgejo, and Azure DevOps clients are each built from a bare reqwest::Client::builder(), so none of them has a timeout.

This routes all four constructors through a shared http_client_builder() that applies a 30-second timeout, so a client cannot be built without one. The forge constructors still add their own TLS and CA options on top before calling .build().

Adds a test that points a client at a listener which accepts and never responds: with the timeout the request errors within a few seconds; a control using the old bare builder is still pending when a short outer deadline fires.

Co-authored-by: Matt Wilkinson matt@rigel.build

…lient

This branch is based on upstream v0.5.4 (0c03418), not on this fork's main. Matt pulls it and pushes it to the upstream Codeberg repo (codeberg.org/abrenneke/jj-vine). The two sections below are the text to open the upstream PR with; they are the deliverable, not this fork PR's own description.

## Upstream PR title

fix: apply a request timeout to every forge HTTP client

## Upstream PR description

`reqwest` applies no request timeout by default. A forge that accepts the TCP connection but never sends a response leaves the client blocked in the socket read indefinitely, with no output and no way out but an external kill. The GitHub, GitLab, Forgejo, and Azure DevOps clients are each built from a bare `reqwest::Client::builder()`, so none of them has a timeout.

This routes all four constructors through a shared `http_client_builder()` that applies a 30-second timeout, so a client cannot be built without one. The forge constructors still add their own TLS and CA options on top before calling `.build()`.

Adds a test that points a client at a listener which accepts and never responds: with the timeout the request errors within a few seconds; a control using the old bare builder is still pending when a short outer deadline fires.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the upstream-vcs/upstream-forge-timeout branch from 0e4e115 to 051761d Compare September 11, 2026 23:25
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.

2 participants