Skip to content

ContainerMetadataCredentials should retry with backoff #193

@bennettgoble

Description

@bennettgoble

When running aiodynamo in an ECS application under high load it is possible to hit timeout issues accessing the container metadata endpoint. I believe the chance of re-connection could be improved if the retry logic implemented some basic backoff.

Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
  File "/opt/venv/lib/python3.12/site-packages/aiodynamo/credentials.py", line 289, in _set_current
    self._current = task.result()
                    ^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/aiodynamo/credentials.py", line 389, in fetch_metadata
    response = await fetch_with_retry_and_timeout(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/aiodynamo/credentials.py", line 604, in fetch_with_retry_and_timeout
    raise TooManyRetries()
aiodynamo.credentials.TooManyRetries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions