Skip to content

Use monotonic time #149

Open
Open
@wapiflapi

Description

@wapiflapi

Backoff uses timedelta.total_seconds(datetime.datetime.now() - start) to compute elapsed time which is used to figure out if max_time has been reached. This is flaky and doesn't work well when the system clock is being updated: when adjusting time from the network or adjusting to daylight saving time for example.

Instead monotonic time should be used, using for example https://docs.python.org/3/library/time.html#time.monotonic

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