Skip to content

Support cleanup-on-start or empty-dir-check as BlobFuse2 CLI parameters for block_cache mode  #1765

Open
@srxmsft

Description

@srxmsft

Context:

We are using Azure Batch with Azure Linux images to mount Azure Blob Storage using BlobFuse2, following the official guidance.

In Azure Batch, the only way to configure BlobFuse2 is through the AzureBlobFileSystemConfiguration.blobfuseOptions field, which passes CLI parameters directly to the BlobFuse2 mount command.

Problem:

When our Azure Batch VMs are rebooted (due to OS upgrades or manual operations), BlobFuse2 does not shut down gracefully. Upon restart, it fails with the following error:

[config error in block_cache "[temp directory not empty]"]

This happens because the block cache directory is not empty, and BlobFuse2 currently performs a strict check on this.

Investigation:

The block_cache component has a cleanup-on-start config option in the

CleanupOnStart bool `config:"cleanup-on-start" yaml:"cleanup-on-start,omitempty"`

However, this option is not exposed via CLI flags and cannot be passed through blobfuseOptions in Azure Batch.

The file_cache component supports the --empty-dir-check CLI flag:

emptyDirCheck := config.AddBoolFlag("empty-dir-check", false, "Disallows remounting using a non-empty tmp-path.")

It also supports the cleanup-on-start config option:
CleanupOnStart bool `config:"cleanup-on-start" yaml:"cleanup-on-start,omitempty"`

The mount.go logic also references the cleanup-on-start config option for file_cache mode
_ = config.UnmarshalKey("file_cache.cleanup-on-start", &cleanupOnStart)

Request:

Please add support for either:

  • --cleanup-on-start
  • --empty-dir-check
    as BlobFuse2 CLI parameters for the block_cache component, so that users relying on CLI-only configuration (e.g., in Azure Batch) can ensure a clean startup after reboots.

This would enable more robust and fault-tolerant behavior in environments where BlobFuse2 is managed non-interactively.

Thank you!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions