Skip to content

Bound the 429 retry and back off exponentially - #70

Open
Pichatorn-A4K wants to merge 1 commit into
Keyfactor:mainfrom
Pichatorn-A4K:fix/rate-limit-retry-ceiling
Open

Bound the 429 retry and back off exponentially#70
Pichatorn-A4K wants to merge 1 commit into
Keyfactor:mainfrom
Pichatorn-A4K:fix/rate-limit-retry-ceiling

Conversation

@Pichatorn-A4K

Copy link
Copy Markdown

The rate-limit branch slept a fixed 5 seconds and then re-entered Request()
recursively with no attempt ceiling, with a '// TODO - Figure out how long to
wait' left in place.

DigiCert documents two limits - 1000 requests per 3 minutes and 100 per 5
seconds, rolling, per API key - and recommends exponential backoff with a
default maximum of 3 retries. Its 429 responses carry no Retry-After header,
so there is nothing to read and the client has to choose the interval.

A fixed 5-second wait only clears the burst window, never the 3-minute one,
so tripping the larger limit turned into an indefinite 5-second poll with a
stack frame per attempt instead of an error the caller could surface. This is
easy to trip on a large account: a full synchronization issues roughly four
GETs per order plus one per certificate.

Now 5s, 10s, 20s, then the 429 body is returned to the caller as an error.

Found during a pre-engagement audit of the shipped 2.4.1 net8.0 assembly; verified by building and running the change against a fake client offline. Companion PRs from the same audit: #65, #66, #67.

🤖 Generated with Claude Code

The rate-limit branch slept a fixed 5 seconds and then re-entered Request()
recursively with no attempt ceiling, with a '// TODO - Figure out how long to
wait' left in place.

DigiCert documents two limits - 1000 requests per 3 minutes and 100 per 5
seconds, rolling, per API key - and recommends exponential backoff with a
default maximum of 3 retries. Its 429 responses carry no Retry-After header,
so there is nothing to read and the client has to choose the interval.

A fixed 5-second wait only clears the burst window, never the 3-minute one,
so tripping the larger limit turned into an indefinite 5-second poll with a
stack frame per attempt instead of an error the caller could surface. This is
easy to trip on a large account: a full synchronization issues roughly four
GETs per order plus one per certificate.

Now 5s, 10s, 20s, then the 429 body is returned to the caller as an error.
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.

1 participant