From bcad88d9117d9fa29db67f6df2b81098c8bf27c3 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Tue, 10 Mar 2026 12:15:20 +0530 Subject: [PATCH] Fix Azure listings_expiry_time regression from PR #1826 Revert listings_expiry_time back to 1 (from 0). A value of 0 breaks because fsspec's DirCache expires entries between write and immediate read, causing KeyError('/') in adlfs's _ls_containers(). Updated comment to document the issue and reference the related GitHub issue. --- .../filesystems/azure_cloud_storage/azure_cloud_storage.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py b/unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py index ecc92da489..9ffe02d767 100644 --- a/unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py +++ b/unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py @@ -41,13 +41,14 @@ def __init__(self, settings: dict[str, Any]): self.bucket = settings.get("bucket", "") # adlfs._ls_containers() unconditionally reads from DirCache after # populating it — use_listings_cache=False makes the write a no-op, - # causing a KeyError. Setting listings_expiry_time=0 allows writes - # but expires entries immediately on subsequent reads. + # causing a KeyError. listings_expiry_time=0 also breaks because + # DirCache expires entries between the write and immediate read + # (even nanoseconds trigger expiry). Use 1s as the minimum safe value. # Check https://github.com/fsspec/adlfs/issues/230 for more context. self.azure_fs = AzureBlobFileSystem( account_name=account_name, credential=access_key, - listings_expiry_time=0, + listings_expiry_time=1, ) @staticmethod