You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/09/21 17:01:18 UTC
[PR] feat(layers/aimd): add adaptive HTTP request pacing [opendal]
Xuanwo opened a new pull request, #8329:
URL: https://github.com/apache/opendal/pull/8329
# Which issue does this PR close?
Closes #8036.
# Rationale for this change
Fixed concurrency and bandwidth limits do not adapt to backend request-rate throttling. Add an optional AIMD layer that paces HTTP requests and adjusts its rate from OpenDAL's typed `RateLimited` feedback.
# What changes are included in this PR?
- Add `opendal-layer-aimd` with independent read, write, delete, and list token buckets. Active windows increase rates additively; windows observing `RateLimited` decrease them multiplicatively within configured bounds. Empty windows leave rates unchanged.
- Admit each HTTP request carrying an OpenDAL `Operation` marker, including pagination and multipart requests. Observe parsed errors through service and I/O wrappers. Unmarked requests, presigning, and non-HTTP I/O bypass pacing.
- Use asyncband for FIFO admission and cancellation without token debt. Cloned layers share budgets across operators and context replacement. Default to Tokio timers and allow callers to supply a sleep function with `with_sleep`.
Admission counts HTTP requests, while feedback belongs to the enclosing storage operation; composite operations may use multiple request categories. The controller therefore uses the presence of `RateLimited`, rather than a ratio of errors to requests. Pacing occurs after signing, and transport-internal redirects or retries are outside the admission boundary.
# Are there any user-facing changes?
Enable `layers-aimd` to use `opendal::layers::{AimdConfig, AimdLayer}`, or depend on the standalone layer crate. Add AIMD before a retry layer so it observes each attempt's errors. The layer does not retry or change error semantics. Existing users are unaffected unless they opt in.
# Breaking changes
# AI Usage Statement
- Harness: Codex desktop.
- Model: `gpt-6-astra`.
- Effort: `high`.
- Role: Researched the design, implemented the layer and focused tests, and prepared this PR under human direction. Validation covers local algorithm and layer behavior; adaptive behavior against a live storage service has not been measured.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org