Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 2.02 KB

File metadata and controls

31 lines (24 loc) · 2.02 KB
title include file
description include file
services storage
author pauljewellmsft
ms.service azure-blob-storage
ms.topic include
ms.date 02/16/2023
ms.author pauljewell
ms.custom include file

Lease states and actions

The following diagram shows the five states of a lease, and the commands or events that cause lease state changes.

:::image type="content" source="../../articles/storage/blobs/media/blob-dev-guide/storage-dev-guide-container-lease.png" alt-text="A diagram showing container lease states and state change triggers." lightbox="../../articles/storage/blobs/media/blob-dev-guide/storage-dev-guide-container-lease.png":::

The following table lists the five lease states, gives a brief description of each, and lists the lease actions allowed in a given state. These lease actions cause state transitions, as shown in the diagram.

Lease state Description Lease actions allowed
Available The lease is unlocked and can be acquired. acquire
Leased The lease is locked. acquire (same lease ID only), renew, change, release, and break
Expired The lease duration has expired. acquire, renew, release, and break
Breaking The lease has been broken, but the lease will continue to be locked until the break period has expired. release and break
Broken The lease has been broken, and the break period has expired. acquire, release, and break

When a lease expires, the lease ID is maintained by the Blob service until the container is modified or leased again. A client may attempt to renew or release the lease using the expired lease ID. If the request fails, the client knows that the container was leased again, or the container was deleted since the lease was last active.

If a lease expires rather than being explicitly released, a client may need to wait up to one minute before a new lease can be acquired for the container. However, the client can renew the lease with the expired lease ID immediately.