Repository navigation
Fix 'NoneType' object has no attribute when querying during Session not available retry - #37578
Merged
Merged
Conversation
Fixes 'NoneType' object has no attribute when session retry is triggered and does not succesfully retry while querying.
bambriz
requested review from
a team and
Anna Tisch (annatisch)
as code owners
September 25, 2024 21:55
Member
Author
|
/azp run python - cosmos - ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
API change check API changes are not detected in this pull request. |
Member
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Allen Kim (allenkim0129)
requested changes
Sep 27, 2024
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Philip Thomas (philipthomas-MSFT)
approved these changes
Oct 2, 2024
Simon Moreno (simorenoh)
approved these changes
Oct 2, 2024
Allen Kim (allenkim0129)
approved these changes
Oct 2, 2024
Waqas Javed (w-javed)
pushed a commit
to w-javed/azure-sdk-for-python
that referenced
this pull request
Oct 3, 2024
…ot available retry (Azure#37578) * Add fixes to 'NoneType' object has no attribute when querying Fixes 'NoneType' object has no attribute when session retry is triggered and does not succesfully retry while querying. * Update CHANGELOG.md * update test files
Libba Lawrence (l0lawrence)
pushed a commit
to l0lawrence/azure-sdk-for-python
that referenced
this pull request
Feb 19, 2025
…ot available retry (Azure#37578) * Add fixes to 'NoneType' object has no attribute when querying Fixes 'NoneType' object has no attribute when session retry is triggered and does not succesfully retry while querying. * Update CHANGELOG.md * update test files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When Session Retry, Timeout Failover, and Endpoint Discovery retry policies are triggered and do no successfully retry during a Query, a bug occurs that raises a 'NoneType' object has no attribute from a request object. This was caused from the request to fetch the queried items returning back to the base request to start the query. Instead of returning the Cosmos Exception from not successfully retrying, the retry would happen again for the base query request, but the base query request does not have a reference to the Request Object (This is where the 'NoneType' object has no attribute error comes from). This is fixed by allowing the cosmos exception to surface by not retrying at the base request since we already used up the retry attempts while fetching the items during the query.
graph TD A[Execute Base Query Request] --> B[Fetch Items Per Page] B --> C[Request Per Page of Queried Items] C -->|Retry Fails| D[Exception] D --> E[Return to Base Execution] E -->|Check Retry| F[Nonetype Exception]graph TD A[Execute Base Query Request] --> B[Fetch Items Per Page] B --> C[Request Per Page of Queried Items] C -->|Retry Fails| D[Cosmos Exception] D --> E[Exception Surfaces to User]