locked
StorageClientException azure table query RRS feed

  • Question

  • I am doing some querying to azure table using async queries. i get StorageClientException when i ask for rows in interval time frame of 4 hours. 

    the exception messge is:
    Unexpected internal storage client error.

    StackTrace is:
     

    at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()

    at Microsoft.WindowsAzure.StorageClient.Tasks.TaskAsyncResult`1.EndInvoke()

    at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.EndImpl[T](IAsyncResult asyncResult)

    at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.EndImplWithRetry[T](IAsyncResult asyncResult)

     

    at Microsoft.WindowsAzure.StorageClient.CloudTableQuery`1.EndExecuteSegmented(IAsyncResult asyncResult)

     

    the error came from the following method call :

    CloudTableQuery EndExecuteSegmented(result)

     

     

     

    any help will be welcomed.



     



    Tuesday, May 17, 2011 7:24 AM

Answers

  • The issue you have encountered is a safety put in place to work around an issue in a previous release which made it was possible for certain queries to never return. As such a Maximum query time of 120 seconds was put in place such that any perceived “hung” queries could be aborted and the thread would return.   (Not we are looking at this for an upcoming release of the Storage Client library).

    Unfortunately it is also possible to hit this scenario while on a slow edge connection, or when performing extremely slow queries (such as non-indexed table scans etc.) Your initial post mentions you hit this issue when querying for rows within a 4 hr interval, if this is based on timestamp or another unindexed column then this is a non-indexed query that can take some time to complete, especially in a large table that spans numerous partitions. (Please see blog post here regarding table best practice, as well as efficient querying & key selection)

    If this continues, could you please post the PK/ RowKey selection as well as the query you are executing?

    Thanks,

    Joe Giardino

    • Marked as answer by Shay Yannay Thursday, June 2, 2011 2:20 PM
    Friday, May 27, 2011 5:34 PM

All replies

  • just to make things clear i am doing multiple queries at each time
    Wednesday, May 18, 2011 12:11 PM
  • Hello azuredevsh,

    Thank you posting!

    This is a quick note to let you know that I am performing research on this issue and will get back to you as soon as possible. I appreciate your patience.

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, May 18, 2011 1:05 PM
  • thanks.

    this problem is extremely frustrating 

    Wednesday, May 18, 2011 1:10 PM
  • Hi azuredevsh,

    Are you reusing a TableServiceContext object?

    Avkash Chauhan wrote a blog Unexpected Internal Storage Client Error when using Windows Azure Storage Client Library which describes this error when reusing an old TableServiceContext object. And the solution is to re-create a new one.

    It it does not help, can you show some code or a repro project?

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, May 18, 2011 1:49 PM
  •  

     


    thanks for replying.

    i am familiar with this solution on creating new context and already done that. 

    but unfortunately it didn't help. 

    i am using  CloudTableQuery<MyData> query (taken from a new context  instance each time).

    AsyncCallback callback // check below for more info

    and using query.BeginExecuteSegmented(query,callback)

     

    when the callback get called i am using (result.AsyncState as CloudTableQuery<MyData>).EndExecuteSegmented(result); // this is the place i get the exception

    please note that i am doing async queries in for loop.

    and each query is a bit different.

     

      

     



    Wednesday, May 18, 2011 2:27 PM
  • Hi azuredevsh,

    Thanks for your response.

    I am trying to involve someone familiar with this topic to further look at this issue. Can I ask you a few questions?

    1. What is the Azure SDK version?

    2. Does it happens only in emulator or both in emulator and on cloud?

    3. Can you use fiddler to collect the failed request log? From response we may get some clues.

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Thursday, May 19, 2011 6:04 AM
  • Hi

    1. I am using azure sdk 1.4
    2. this happened on the cloud (production environment)
    3. for security reasons i cant use fiddler.

    Thanks for the help.

    Thursday, May 19, 2011 7:00 AM
  • Hi azuredevsh,

    Thanks for your response again.

    I'm sorry that we are still not able to reproduce the issue. May I ask you for a sample code? That will be really helpful to troubleshoot this issue.

    Thanks a lot,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Monday, May 23, 2011 1:36 AM
  • The issue you have encountered is a safety put in place to work around an issue in a previous release which made it was possible for certain queries to never return. As such a Maximum query time of 120 seconds was put in place such that any perceived “hung” queries could be aborted and the thread would return.   (Not we are looking at this for an upcoming release of the Storage Client library).

    Unfortunately it is also possible to hit this scenario while on a slow edge connection, or when performing extremely slow queries (such as non-indexed table scans etc.) Your initial post mentions you hit this issue when querying for rows within a 4 hr interval, if this is based on timestamp or another unindexed column then this is a non-indexed query that can take some time to complete, especially in a large table that spans numerous partitions. (Please see blog post here regarding table best practice, as well as efficient querying & key selection)

    If this continues, could you please post the PK/ RowKey selection as well as the query you are executing?

    Thanks,

    Joe Giardino

    • Marked as answer by Shay Yannay Thursday, June 2, 2011 2:20 PM
    Friday, May 27, 2011 5:34 PM
  • First thanks for the help Wenchao and Joe.

     

    Joe.

    the maximum query time could be the problem since 

    I've noticed that the answer from the callback on a 4 hours interval queries done in multi threads 

    could take more then 120 seconds.

    i will check if i can split the queries to 1 hour interval tops (in order to reduce the query time) and see if the exception occurs

    are there any assumption on when the fix for the Storage client libary will be (and what are the impact on the azure sdk ?).

     

    Thanks.

     

     

     

     

    Sunday, May 29, 2011 7:35 AM
  • well..........

    after several tests the 120 time barrier is the problem.

    just to make it clear if the query takes more then 120 seconds StorageClientException is thrown.

    are there any workaround for that ?

     

     

    Sunday, May 29, 2011 8:35 AM