-
Notifications
You must be signed in to change notification settings - Fork 431
Does PynamoDB support Boto3's various retry modes? #1268
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
Comments
I haven't been using the library for a while (my current work is in the golang ecosystem) but IIRC #1079 has switches PynamoDB back to use more of botocore under the hood, which should leverage botocore's retry behavior. I suspect boto3's retry settings are controlling the botocore implementation, so we should respect the retry settings. Do you mind giving it a try? Maybe there's a reasonable integration test we can add, e.g. if we fashion a simple proxying server with https://docs.python.org/3/library/http.server.html, so we could inject errors. |
I found where I believe PynamoDB configures this retry behavior in the Connection class when instantiating the botocore client: PynamoDB/pynamodb/connection/base.py Line 407 in f0bc917
This looks like it overrides whatever may be set in a AWS configuration file. I guess it would be a feature request to allow setting this retry configuration dict somewhere in code (I don't know where is best) or allowing botocore to read it from an AWS configuration file? It appears that the retry configuration in regular botocore can be set in two ways:
The passing a |
Oh yes, we definitely need to fix this. It makes no sense to hardcode a retry mode here. |
I don't know how to make this a non-breaking change, as it looks like the default settings for retry attempts is 3: https://pynamodb.readthedocs.io/en/stable/settings.html#max-retry-attempts This is the value that gets used in that retry config block. The only way to allow botocore to use the |
I suppose we'd have to add a |
I'm looking at using PynamoDB over direct use of Boto3 to talk to DynamoDB. However, one of the features of Boto3 I've been using is its retry modes. I didn't find any similar retry mode configuration options in the PynamoDB connection API docs. It's not clear to me where botocore ends and boto3 begins, and whether PynamoDB supports this functionality based on using botocore.
The text was updated successfully, but these errors were encountered: