You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 38f64cd
Browse filesBrowse the repository at this point in the historyBrowse files
IMDS requests are now retried with capped exponential backoff. The token fetch and the metadata read are retried together,
so a retry gets a new token when it needs one. Every failure is retried
except a token request rejected with 400 or 403 and a metadata request
answered with 403 or 404. A 401 drops the rejected token before the retry,
so the next attempt fetches a new one. Any error from sending a request or
reading its body counts as a failed request, since urllib3 and aiohttp raise
different types for the same dropped or reset connection.
IMDSConfig.retry_strategy is replaced by max_attempts. It defaults to 4,
or 3 retries, and can be set with
AWS_METADATA_SERVICE_NUM_ATTEMPTS or metadata_service_num_attempts, the
same settings botocore reads. Backoff waits 0.25 s, 0.5 s and then 1 s.
IMDS requests now time out after 1 second. The async client enforces this
itself, because aiohttp ignores the per-request read timeout. A caller's
sync client keeps its own connect timeout, because a request can't override
it.
Session tokens now expire after the TTL IMDS returns. Both token caches read
the cached token once, so a token invalidated by another caller can't fail a
request that already checked it. Response bodies are closed after every
read, so a failed attempt doesn't hold a connection from the caller's pool.
"description": "Failed IMDS credential requests are now retried with capped exponential backoff, except a token request rejected with 400 or 403 and a metadata request answered with 403 or 404. `IMDSConfig.retry_strategy` is replaced by `max_attempts`, which defaults to 4 (3 retries) and can also be set with `AWS_METADATA_SERVICE_NUM_ATTEMPTS` or the `metadata_service_num_attempts` config setting. IMDS requests now time out after 1 second, except the connect timeout of an HTTP client you provide to the synchronous client, which is left as configured. Session tokens now expire after the TTL IMDS returns, which can differ from the one requested. The `send` callable given to `fetch_token` and `fetch_metadata` now also receives an `HTTPRequestConfiguration`, and `fetch_token` returns an `IMDSToken` instead of a `str`. `aws_credentials_imds.client` and `aws_credentials_imds.aio.client` no longer re-export `fetch_metadata`; use `get_metadata`, which adds the retries."
0 commit comments