Skip to content

Make http_client's max_retries configurable #432

Closed

Description

@jiasli

Symptom

The one-time retry introduced by #326 seems to be insufficient:

a = requests.adapters.HTTPAdapter(max_retries=1)
self.http_client.mount("http://", a)
self.http_client.mount("https://", a)

Transient ConnectionError can still makes MSAL fail: #431

Alternatives

Of course I can provide my HTTP client, but this seems too heavy for such as small parameter tweak.

Activity

  1. rayluo commented on Nov 3, 2021

    @rayluo
    Contributor

    This issue was created when #431 was observed. Now we have addressed #431 in its corresponding PR, by providing clearer error message. End user will then make educated decision on manual retry when needed. So, there is less need for an app to automatically choose a max retries value.

    Besides, max_retries is an http layer behavior. It does not really belong to the MSAL or OAuth2 layer. We choose to not make this change.

  2. jiasli commented on Jul 30, 2024

    @jiasli
    ContributorAuthor

    I want to reopen this issue as Azure/azure-cli#29452 is requesting managed identity authentication's retry to be configurable.

  3. doubleyewdee commented on Jul 30, 2024

    @doubleyewdee

    Jiashuo Li (@jiasli) yes, we'd appreciate being able to tune retries here (it looks like there's at least one retry which is better than what we have today already so that's excellent)

  4. rayluo commented on Aug 1, 2024

    @rayluo
    Contributor

    I want to reopen this issue as Azure/azure-cli#29452 is requesting managed identity authentication's retry to be configurable.

    Instead, please consider use a customized http_client with your own retry logic instead.

    (it looks like there's at least one retry which is better than what we have today already so that's excellent)

    Note that the default retry-once behavior is only available in MSAL Python's non-Managed Identity code path. For managed identity, the current API requires the caller to provide an http_client anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions