Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Azure MessageLockLostException

I'm having issues with Azure Message Bus Queues.

I'm having MessageLockLostException thrown and The request operation did not complete within the allotted timeout of 00:01:10. The time allotted to this operation may have been a portion of a longer timeout.

I've set my queue into ReceiveMode.PeekLock.

I also check

if(message.LockedUntilUtc.Minute <= 1)
    message.RenewLock();

Why would this happen, what's causing the lock to give out? I was reading somewhere from the point where you Receive you have 5 minutes by default. This process takes a little longer usually. I wanted to renew the lock but this isn't working too well.

like image 500
Styles Avatar asked Mar 08 '13 21:03

Styles


1 Answers

The LockDuration is property of the Queue. You typically set this when you create the Queue. This is Queue level property and cannot be changed on a message base. What you've read, most probably is saying that this duration cannot be longer than 5 minutes. The default value is 1 Minute, that's why you face issues. And why you face it 70 seconds later - I assume the logic for checking this conditions is executed every 10 seconds.

So I suggest that you create or modify your Queue to set LockDuration property to 5 minutes. Then, while working RenewLock of your message when appropriate.

like image 80
astaykov Avatar answered Sep 28 '22 05:09

astaykov