locked
Crashing worker thread & Executing the same job & ETag RRS feed

  • Question

  • Hi,

    Assume a worker thread performs and update on a blob in place (I think the ETag of the blob content changes). But before dequeuing the message it crashes. After timeout is reached, message becomes visible and another thread comes and takes the message.

    My question is, can the new thread modify the blob again or it is not allowed since the ETag is changed by the previous thread that performed the same job?

    Thanks.

    Wednesday, October 10, 2012 8:07 AM

Answers

  • It depends how you're performing the updates on the blob. If you're doing conditional update by specifying the ETag value, then the update will fail as the ETag passed to the new thread is not the same as the original ETag. Unconditional updates will result in overwriting the blob.

    You can read more about conditional updates here: http://msdn.microsoft.com/en-us/library/windowsazure/dd179371.aspx

    Hope this helps.

    • Marked as answer by BurcuOzkan Wednesday, October 10, 2012 1:09 PM
    Wednesday, October 10, 2012 9:48 AM

All replies

  • It depends how you're performing the updates on the blob. If you're doing conditional update by specifying the ETag value, then the update will fail as the ETag passed to the new thread is not the same as the original ETag. Unconditional updates will result in overwriting the blob.

    You can read more about conditional updates here: http://msdn.microsoft.com/en-us/library/windowsazure/dd179371.aspx

    Hope this helps.

    • Marked as answer by BurcuOzkan Wednesday, October 10, 2012 1:09 PM
    Wednesday, October 10, 2012 9:48 AM
  • I understand that it is possible to prevent the blob being modified more than once (which is unintended but caused by crash of the thread). For example, I can use "If-Match" header to check the ETag is same with the version I want to modify.

    Thanks, that really helped.

    Wednesday, October 10, 2012 1:09 PM