none
Null reference at StorageClient.Tasks.DelayTask.EndDelay

    Question

  • I have an Azure worker role which hits some XML-based web services, extracts the information I need from them, reformats the data, and uploads it to blob storage. Some of this data includes images, etc. If I run this program locally using the dev fabric, it runs fine. If I run it locally and point to remote storage, it also runs fine. If I run it in the cloud, it will usually and randomly crash with the following stack trace:

    System.NullReferenceException: Object reference not set to an instance of an object.

       at Microsoft.WindowsAzure.StorageClient.Tasks.DelayTask.EndDelay()

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

       at System.Threading._TimerCallback.PerformTimerCallback(Object state)

    Originally I was using a single instance of CloudBlobClient for all of my blob operations. I thought that changing my code to use a new instance for each request might solve the problem, but unfortunately it did not.

    Been struggling with this for a while, any advice would be appreciated.

    Friday, August 13, 2010 4:01 PM

Answers

  • I think you hit an issue described here. As described on that post, this has been fixed. We are really sorry for the inconvenience this has caused.

    -Jai

    Sunday, March 27, 2011 2:03 AM

All replies

  • Hello, I haven't seen this problem. But it seems to be caused by retry policy. The code branch displayed in the call stack should only be invoked when a retry occurs, and there's a delay between two attempts. Can you do a test? When creating the retry policy, set the delay interval to 0. Do you still see the same issue?
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 16, 2010 3:13 AM
  • Thanks for your response. I went back to using one instance of the blob client for all operations, creating it like this:

     

    CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting(RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));

    _blobClient = account.CreateCloudBlobClient();

    _blobClient.RetryPolicy = RetryPolicies.Retry(5, TimeSpan.Zero);


    I'm not sure if that's correct; I haven't worked with RetryPolicies before.

    Either way, it didn't solve the issue. The role crashed with the same stack trace as before.

    Monday, August 16, 2010 8:37 PM
  • I think you hit an issue described here. As described on that post, this has been fixed. We are really sorry for the inconvenience this has caused.

    -Jai

    Sunday, March 27, 2011 2:03 AM