rebus-org / Rebus.AzureStorage

:x: DEPRECATED :bus: Azure Storage transport, databus storage, etc. for Rebus
https://mookid.dk/category/rebus
Other
5 stars 5 forks source link

When using DataBus there is an exception on Blob with status code 412 #10

Closed BadiSatwa closed 4 years ago

BadiSatwa commented 4 years ago

Hi,

Our situation is like this:

From time to time we have an exception: Microsoft.Azure.Storage.StorageException: The condition specified using HTTP conditional header(s) is not met. at Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteAsync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token) at Microsoft.Azure.Storage.Blob.BlobReadStream.DispatchReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at Microsoft.Azure.Storage.Blob.BlobReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.CopyTo(Stream destination, Int32 bufferSize)

Return status is 412 and message is landing in error queue.

What do you think about that?

Kind Regards, Piotr Balas

Efp95 commented 4 years ago

I'm having the same issue. Is it any update regarding this?

mookid8000 commented 4 years ago

Ah damn, this must be because each reader tries to update the last-read-time property of the blob, and then they run into a race condition.

The correct action in this case would be to simply ignore the etag of the blob when updating the last-read-time, because in this case, the last one to write is always right. 🙂

I can probably fix this within a couple of days, but a PR is also most welcome.

mookid8000 commented 4 years ago

Could you try Rebus.AzureStorage 4.3.1 and see if it's fixed? (I think it is 🙂 )