Skip to content

classretry now retries auth failure #156

@xarses

Description

@xarses

Introduced in #155, By moving from sys.exit(...) to raise(...) I now see that auth failures are now retried by the classretry decorator

I'm partial to implementing a custom Exception and using that to short circuit the retry decorators thoughts?

Currently:

[2024-09-15T11:42:55.778-0700] {logger.py:246} INFO - Retrying in 3 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:42:59.083-0700] {logger.py:246} INFO - Retrying in 5 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:04.566-0700] {logger.py:246} INFO - Retrying in 11 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:16.477-0700] {logger.py:246} INFO - Retrying in 29 seconds - error: Cannot respond to request for authentication.
[2024-09-15T11:43:46.062-0700] {logger.py:246} INFO - Retrying in 83 seconds - error: Cannot respond to request for authentication.
ERR: Failure fetching config: docker.io/ymuski/curl-http3:latest

After adding an explicit raise to the retry decorator

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/Users/andrew.woodward/git/system/container.py", line 80, in update_images
    item.get_config()
  File "/Users/andrew.woodward/git/system/models/container.py", line 61, in get_config
    i for i in get_container_details(self.key) if i.get("architecture")
  File "/Users/andrew.woodward/git/system/libs/container/registry.py", line 132, in get_container_details
    data = client.get_manifest(container)
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 36, in __call__
    return self.func(cls, *args, **kwargs)
  File "/Users/andrew.woodward/git/system/libs/container/registry.py", line 48, in get_manifest
    response = self.do_request(uri, "GET")
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 57, in __call__
    raise e
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/decorator.py", line 55, in __call__
    return self.func(cls, *args, **kwargs)
  File "/Users/andrew.woodward/git-untrused/oras-py/oras/provider.py", line 985, in do_request
    raise oras.auth.AuthenticationException(
oras.auth.AuthenticationException: Cannot respond to request for authentication.

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