RyanShao
RyanShao

Reputation: 425

Why Azure Blob's lease time span limit to 60s

In my workflow, i want to acquire the lease to keep alive for serveral hours to make sure my most time consumption operation could success. if it is timeout, it basically means something wrong,so i need the lease will expire, so that others can still operate/modify the blob.

why the limit is 60s? not 1 hour? or 1 day? and the parameter accept a TimeSpan, it is quite easy to use wrongly!

Upvotes: 3

Views: 1472

Answers (1)

Fei Han
Fei Han

Reputation: 27805

why the limit is 60s? not 1 hour? or 1 day?

As we know, if you request a lease on a Blob by calling AcquireLease method, the Blob will be locked until lease expires, and nobody else can modify/update the Blob while you acquired a lease on this Blob. If the default lock duration is 1 hour or longer, it will lock the Blob for a long time, once something wrong with the code and you do not release the lease by yourself, others who want to do with this Blob must wait 1 hour or longer time for your lease expired, which will not a good user experience.

If you’d like to lease the Blob for a long time, you could try to use RenewLease method to renew a lease, or you could acquire a lease for an infinite time period and explicitly release or break the lease after you complete your task.

Upvotes: 2

Related Questions