Skip to content

How to configure backoff retry #92

@aldenks

Description

@aldenks

This package is great to have in the python ecosystem, thank you!

I'm having trouble configuring backoff retries. When I try to do something like the following:

from datetime import timedelta
from obstore.store import HTTPStore

store = HTTPStore.from_url(
    "https://...",
    client_options={
        "connect_timeout": "4",
        "timeout": "16",
    },
    retry_config={
        "max_retries": 10,
        "backoff": {
            "base": 2,
            "init_backoff": timedelta(seconds=1),
            "max_backoff": timedelta(seconds=16),
        },
        "retry_timeout": timedelta(minutes=3),
    },
)

I get

    store = HTTPStore.from_url(
            ^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'backoff'

I also attempted to instantiate the config classes like RetryConfig(max_retries=...) rather than as dict literals, but when I run from obstore.store import RetryConfig, BackoffConfig and variations on that I get an ImportError.

Am I doing something wrong?

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