Repository navigation
Conversation
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
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.
Fixes #1631
Summary
The shared AUR RPC
reqwest::Clientpreviously configuredtcp_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
AUR_RPC_CONNECT_TIMEOUT(15s) andAUR_RPC_TIMEOUT(30s) constants and abuild_aur_client(timeout)helper insrc/config.rsconfiguring.tcp_keepalive,.connect_timeout,.timeout, and.user_agent.Config::initto build the AUR RPC client viabuild_aur_client(AUR_RPC_TIMEOUT).aur_rpc_client_times_out_on_stalled_response_body) reproducing a hung partial HTTP response body and verifying thatraur::Handle::inforeturnsraur::Error::Reqwestwithis_timeout() == true.Testing
Paruworkflow on Arch Linux container):test(cargo fmt -- --check,cargo build,cargo test,startupintegration test): passedtest-git(--features git,generate): passedmsrv(Rust 1.88): passed