Give up on a stalled read or write after 5 minutes #60

Merged
jcoffey-dev merged 1 commits from fix/stalled-transfer-timeouts into main 2026-11-04 03:30:29 +00:00
Owner

Follow-up to #59, which left out upstream's HTTP timeouts because net::with_timeouts already covers these clients. That was true for silent servers, but not for a transfer that stalls partway:

  • A stalled download waited out RECV_BODY, 30 minutes.
  • A stalled upload waited out its send budget, over two hours for the largest bodies.

This adds PER_READ and PER_WRITE, 5 minutes each, to with_timeouts. Both restart with every read or write, so a slow transfer that keeps moving isn't affected, and the whole-body budgets still apply. 5 minutes matches RECV_RESPONSE, so it doesn't cut the server's thinking time short. A timeout is retried like any other, and the retry tests in all four clients now cover both.

Checked

  • cargo test --locked: 1606 passed, 0 failed, 71 ignored. cargo fmt --check is clean.
  • Two new tests stall a real socket, one partway through a response body and one partway through an upload, and each gets the expected timeout.
  • The #[ignore]d live-server tests were not run.
Follow-up to #59, which left out upstream's HTTP timeouts because `net::with_timeouts` already covers these clients. That was true for silent servers, but not for a transfer that stalls partway: - A stalled download waited out `RECV_BODY`, 30 minutes. - A stalled upload waited out its send budget, over two hours for the largest bodies. This adds `PER_READ` and `PER_WRITE`, 5 minutes each, to `with_timeouts`. Both restart with every read or write, so a slow transfer that keeps moving isn't affected, and the whole-body budgets still apply. 5 minutes matches `RECV_RESPONSE`, so it doesn't cut the server's thinking time short. A timeout is retried like any other, and the retry tests in all four clients now cover both. **Checked** - `cargo test --locked`: 1606 passed, 0 failed, 71 ignored. `cargo fmt --check` is clean. - Two new tests stall a real socket, one partway through a response body and one partway through an upload, and each gets the expected timeout. - The `#[ignore]`d live-server tests were not run.
jcoffey-dev added 1 commit 2026-11-04 03:18:35 +00:00
Give up on a stalled read or write after 5 minutes
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 5m23s
ci / announce (pull_request) Skipped
76070a8abe
A transfer that stalled partway waited out the budget for the whole body: 30 minutes for a download, over two hours for the largest uploads. ureq 3.5 can time each read and write separately, so a silent socket now fails after 5 minutes and is retried like any other timeout.
jcoffey-dev merged commit c38c29570e into main 2026-11-04 03:30:29 +00:00
jcoffey-dev deleted branch fix/stalled-transfer-timeouts 2026-11-04 03:30:29 +00:00
Sign in to join this conversation.