I've got a BrokeredMessageContext class which uses a Timer to periodically check and renew the lock on a BrokeredMessage instance in case the process that handles this message runs for longer than expected. It renews the lock by calling the RenewLock() method on the BrokeredMessage instance.
I expected this call to give me a new lock with the same timeout as the original lock (MSDN states that "You can renew locks for the same duration as the entity lock timeout, and there is no maximum duration for a lock renewal."), but when debugging it appears that the lock timeout is increased by an 'arbitrary' 10-15 seconds. I've set a watch on the BrokeredMessage instance and I can see that the LockedUntilUtc propery has 10-15 seconds added to it every time I call RenewLock().
Does anyone know why this is the case? Can anything be done to renew the lock for longer?
EDIT:
Mike's answer, below, is correct. I discovered that I was, in fact, trying to renew the lock every ten seconds right from the start even though my code was intended to renew the lock now earlier than twenty seconds prior to the lock expiring. It all came down to a time comparison issue and the fact that the time on my machine was wrong (it was ahead by nearly a minute). D'oh!