title: Why does BrokeredMessage.RenewLock() only renew the lock for a few seconds?
body: <p>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.</p>
  
  <p>I expected this call to give me a new lock with the same timeout as the original lock (<a href="http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.brokeredmessage.renewlock.aspx" rel="noreferrer">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."</a>), 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().</p>
  
  <p>Does anyone know why this is the case? Can anything be done to renew the lock for longer?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Mike's answer, below, is correct. I discovered that I was, in fact, trying to renew the lock every ten seconds <em>right from the start</em> 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!</p>