Skip to content

Migrate from backoff to backon - drop-in replacement, archived upstream #718

Description

@Llucs

Is your feature request related to a problem? Please describe.

The backoff library (litl/backoff) was archived in August 2025 and is no longer maintained. It is also incompatible with Python 3.14+ due to the removal of the deprecated asyncio.iscoroutinefunction() API.

Censys Python currently depends on backoff >=2.0.0,<3.0.0 and uses it in censys/common/base.py:

  • @backoff.on_exception(backoff.expo, ...) for retrying on server/timeout errors
  • @backoff.on_predicate(backoff.runtime, ...) for Retry-After header handling

Describe the solution you would like

Migrate to backon — a modern, actively maintained fork of backoff. It is a drop-in replacement: change only the import statement.

- import backoff
+ import backon
- @backoff.on_exception(backoff.expo, ...)
+ @backon.on_exception(backon.expo, ...)

Migration is trivial — the public API (on_exception, on_predicate, expo, runtime, max_tries, max_time, etc.) is identical. The pyproject.toml dependency would change from:

backoff = ">=2.0.0,<3.0.0"

to:

backon = ">=4.3.0"

Describe alternatives you have considered

  • tenacity — popular but requires significantly more code changes (different API).
  • python-backoff — a community fork that keeps the same API but does not add new features and still relies on the deprecated asyncio.iscoroutinefunction().
  • Staying on backoff — the library is archived and will eventually break on newer Python versions.

backon is the only option that provides identical API compatibility with zero code changes beyond imports, plus it adds features like circuit breakers, hedging, testing utilities, and full type hints.

Additional context

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