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

when retryable error happens, cosmos client returns empty result for pagination query #35021

Closed
hihihuhu opened this issue Mar 31, 2024 · 2 comments
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@hihihuhu
Copy link

  • Package Name: azure-cosmos
  • Package Version: 4.5.2b5 (as well as master)
  • Operating System: linux
  • Python Version: 3.11

Describe the bug
the very first pagination query, means no continuation token, returns no result if a retryable error happens

specifically, if https://github.com/Azure/azure-sdk-for-python/blob/azure-cosmos_4.5.2b5/sdk/cosmos/azure-cosmos/azure/cosmos/_execution_context/aio/base_execution_context.py#L127 throws exception, _has_started, which is set to True already, won't be revert back to the original value, thus when retry calling into _fetch_items_helper_no_retries, it will skip the while loop if there is continuation token, and returns 0 result.

we have verified, if we try catch https://github.com/Azure/azure-sdk-for-python/blob/azure-cosmos_4.5.2b5/sdk/cosmos/azure-cosmos/azure/cosmos/_execution_context/aio/base_execution_context.py#L127 and revert _has_started back to the original value, then the issue is resolved.

To Reproduce
Steps to reproduce the behavior:

  1. send any no QueryItems query with expected non empty result concurrently
  2. until hitting 429
  3. some of the query start returning empty result

Expected behavior
A clear and concise description of what you expected to happen.
the query should either fail or return correct result

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Mar 31, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AbhinavTrips @bambriz @pjohari-ms @simorenoh.

@bambriz
Copy link
Member

bambriz commented Apr 11, 2024

This issue is addressed and fixed in PR 35090 @hihihuhu @nicknotfun

@bambriz bambriz closed this as completed Apr 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants