Skip to content

fix(aur): set connect and request timeouts on AUR RPC client - #1632

Open
Kolgrim33 wants to merge 1 commit into
Morganamilo:masterfrom
Kolgrim33:fix/aur-rpc-timeout
Open

Kolgrim33 wants to merge 1 commit into
Morganamilo:masterfrom
Kolgrim33:fix/aur-rpc-timeout

Conversation

@Kolgrim33

Copy link
Copy Markdown

Fixes #1631

Summary

The shared AUR RPC reqwest::Client previously configured tcp_keepalive(15s) without a connect or total request deadline. When an AUR RPC connection stalled during the TCP/TLS handshake or hung mid-response body, upgrades could block for minutes until OS TCP keepalive probes eventually gave up.

Changes

  • Added AUR_RPC_CONNECT_TIMEOUT (15s) and AUR_RPC_TIMEOUT (30s) constants and a build_aur_client(timeout) helper in src/config.rs configuring .tcp_keepalive, .connect_timeout, .timeout, and .user_agent.
  • Updated Config::init to build the AUR RPC client via build_aur_client(AUR_RPC_TIMEOUT).
  • Added a hermetic loopback unit test (aur_rpc_client_times_out_on_stalled_response_body) reproducing a hung partial HTTP response body and verifying that raur::Handle::info returns raur::Error::Reqwest with is_timeout() == true.

Testing

  • Verified in GitHub Actions (Paru workflow on Arch Linux container):
    • test (cargo fmt -- --check, cargo build, cargo test, startup integration test): passed
    • test-git (--features git,generate): passed
    • msrv (Rust 1.88): passed

The shared AUR RPC reqwest::Client previously configured TCP keepalive
without a connect or request timeout, allowing stalled TLS handshakes
or hung response bodies to block upgrades for minutes until TCP
keepalive expired.

Configure a 15s connect timeout and a 30s total request timeout on the
AUR RPC client, and add a loopback unit test verifying that a stalled
response body fails with a reqwest timeout error.

Fixes Morganamilo#1631
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.

AUR RPC has no request deadline, so an unresponsive connection stalls upgrades for minutes

1 participant