Skip to content

Decoupling Throttling retries logic & Throttling backoff logic. #34

Description

@sushaanttb

As checked from the code, we have 2 retry logics for retrying 429 errors:

image

File: oairequester.py
Class: OAIRequester
Function: _call

& Currently both these two retry logics are coupled together.

This violates Separation of Concerns principle.
Also, not sure if the end user would always want that - i.e. multiple retries for the same request from two different logics.
For example, If Backoff strategy is specified by the user, then the same 429 request which was retried in previous code snippet based on RETRY_AFTER_MS_HEADER will again be retried. multiple times again!

Solution Suggestion
It would be a good idea that (just like backoff) to also parametrize the retry logic from command line arguments.
So that the end user could then accordingly adjust the behavior of retries as per their requirement.

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