Skip to content

Bound concurrent ACR requests and decouple ACR rate limiting from timeouts - #2139

Merged
lbussell merged 2 commits into
dotnet:mainfrom
lbussell:rate-limiting-part-2
Jun 9, 2026
Merged

lbussell merged 2 commits into
dotnet:mainfrom
lbussell:rate-limiting-part-2

Conversation

@lbussell

@lbussell lbussell commented Jun 9, 2026

Copy link
Copy Markdown
Member

Related: #2137

Spurious timeouts were occurring during high-volume ACR operations (e.g. ORAS referrer lookups). Time spent waiting in the client-side rate limiter's queue was being charged against the request timeout

  • Split the resilience pipeline into three levels: Retry → RateLimiter → per-attempt Timeout. The limiter now sits inside retry (so each attempt is counted) but outside the per-attempt timeout (so queue-wait isn't timed). Retries no longer bypass the limiter.
  • Bound concurrency for all ACR operations. Keeps the rate limiting from becoming overloaded/throttling too hard. This increases throughput from ~1.4 → ~3.5 req/s in my local testing.

@lbussell
lbussell requested a review from a team as a code owner June 9, 2026 21:14
@lbussell
lbussell merged commit 94f2775 into dotnet:main Jun 9, 2026
8 of 10 checks passed
@lbussell
lbussell deleted the rate-limiting-part-2 branch June 9, 2026 21:32
lbussell added a commit that referenced this pull request Jun 17, 2026
This PR fixes #2141. The issue text contains the detailed explanation of
why these changes are necessary, but summarizing here:

- The previous rate limiting changes, #2137 and #2139, were too
restrictive and slowed down publishing too much - it was an order of
magnitude slower than the theoretical lowest ACR rate limit due to
unnecessarily tight parallelism limits.
- ACR referrer lookups have a much lower rate limit than the rest of the
API.
- Therefore, this PR reverts parallelism limits and applies rate
limiting to *only* the ACR referrer lookup through OrasDotnetService
using a named HttpClient.
- Http resilience changes from the previous PRs remain in place.

---------

Co-authored-by: Copilot <[email protected]>
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