1

As it said there https://msdn.microsoft.com/en-us/library/azure/dd135718.aspx

"It is possible for a query to return no results but to still return a continuation header."

So my question is - what then should the behaviour of caller be?

  1. Retry again after some time?
  2. Consider it as end of the results set?
  3. Make new query without cont. token updating filters based on the last data retrieved?

It is also said, "A query against the Table service may return a maximum of 1,000 items at one time and may execute for a maximum of five seconds. If the result set contains more than 1,000 items, if the query did not complete within five seconds, or if the query crosses the partition boundary, the response includes headers which provide the developer with continuation tokens to use in order to resume the query at the next item in the result set. Continuation token headers may be returned for a Query Tables operation or a Query Entities operation."

So it looks like the retry strategy can lead us into infinite loop when empty results with continuation token is always returned...

1
  • I seem to be running into an infinite loop (or near infinite loop that exits seemingly arbitrarily since each result set is always empty). You assumptions about the retry logic appear to be correct, but I would love clarity into what the best programming pattern really should be. Commented May 18, 2016 at 0:25

1 Answer 1

1

You should immediately build and use the next query and pass the continuation token in it. As described here: Query Timeout and Pagination. The table storage will be searched beginning from the position where the previous request ended. You got an empty result because the table storage didn´t find any matching data within the five seconds, but there are still data left to search.

After you have retrieved the continuation tokens, use their values to construct a query to return the next page of results.

If you use .NET and the assembly Microsoft.WindowsAzure.Storage there is a BeginExecuteQuerySegmented method which builds all the requests for you. Example: https://stackoverflow.com/a/13428086/1051244

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.