1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Azure Blob direct multipart upload/range download protocols using SharedKey.
//!
//! # Uncommitted blocks and storage cost
//!
//! A block-blob upload stages data with `Put Block` and only materializes the
//! blob once `Put Block List` commits. If the upload is interrupted before
//! commit (process crash, power loss, an unrecoverable error, or a cancel whose
//! cleanup `DELETE` also fails), the staged **uncommitted blocks remain on the
//! service and are billed**. Azure garbage-collects uncommitted blocks only
//! after roughly seven days of blob inactivity, so cost can accrue until then.
//!
//! Unlike OSS multipart, Azure block blobs have no separate session id: the
//! resume state is the uncommitted block list keyed by the blob URL, so
//! [`crate::api::UploadResumeInfo::provider_upload_id`] is always `None` here.
//! To bound the cost:
//!
//! 1. **Configure a lifecycle management rule (strongly recommended)** on the
//! storage account/container to delete stale or never-committed blobs, so the
//! service reclaims abandoned uploads on a schedule you control rather than
//! relying solely on the ~7-day default.
//! 2. **Clean up proactively when you can.** On cancel the executor deletes the
//! target blob; if that `DELETE` fails it is now reported at `WARN` level
//! (tag `cancel_group`) instead of being swallowed. After a crash, deleting
//! the blob URL (or letting the lifecycle rule fire) discards the staged
//! uncommitted blocks.
pub use AzureBlobDirectDownload;
pub use AzureBlobDirectUpload;
pub use block_list_xml;