Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the client sometimes would not retry #109

Merged

Conversation

Pandede
Copy link
Contributor

@Pandede Pandede commented Nov 6, 2024

Resolves #108
After upgrading 2.9.0, sometimes the retry would not works as expected.
The temporary solution is downgrading to 2.8.3.

Root cause

This issue is inducted by the mechanism of checking whether skip the retry:

if response.method not in self._retry_options.methods:
return True

Sometimes, response.method is the string in lowercase (such as get) while self._retry_options.methods is a set of uppercase strings (such as {'GET', 'POST'}), the retry will be skipped, which does not match the expectation.

Solution

Ensure the method string is comparing in the same case.

@inyutin inyutin merged commit 39b2391 into inyutin:master Nov 6, 2024
8 checks passed
@inyutin
Copy link
Owner

inyutin commented Nov 6, 2024

@Pandede cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different behavior after upgrade to 2.9.0
2 participants