Skip to content

[MISC] Fix Azure listings_expiry_time regression from PR #1826#1839

Merged
gaya3-zipstack merged 1 commit intomainfrom
fix/azure-listing-expiry
Mar 10, 2026
Merged

[MISC] Fix Azure listings_expiry_time regression from PR #1826#1839
gaya3-zipstack merged 1 commit intomainfrom
fix/azure-listing-expiry

Conversation

@chandrasekharan-zipstack
Copy link
Copy Markdown
Contributor

What

Reverted listings_expiry_time from 0 back to 1 in Azure Cloud Storage filesystem configuration. Updated the explanatory comment to document why 0 breaks and reference the related fsspec/adlfs issue.

Why

PR #1826 changed the value to 0 based on a review comment, but this breaks Azure file listing operations. fsspec's DirCache expires entries between the write and immediate read operations, causing a KeyError('/') in adlfs's _ls_containers() function. This surfaces as "Error listing files. '/'" to users.

How

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

No. This fix restores the working behavior prior to PR #1826. Azure Cloud Storage file listing will work correctly again.

Database Migrations

  • None

Env Config

  • None

Relevant Docs

Related Issues or PRs

Dependencies Versions

  • None

Notes on Testing

  • Manual testing with Azure Cloud Storage connector should confirm files can be listed without KeyError
  • Regression test: Create an Azure connector, verify file listing works in the UI

Screenshots

None

Checklist

I have read and understood the Contribution Guidelines.

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.
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

Summary
  • Runner Tests: 11 passed, 0 failed (11 total)

Runner Tests - Full Report
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_for\_sidecar}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_sidecar\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{11}}$$ $$\textcolor{#23d18b}{\tt{11}}$$

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 10, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved Azure Cloud Storage stability by optimizing cache expiration settings. This prevents cache invalidation issues that occurred between consecutive write and read operations, ensuring more reliable and consistent file system behavior when working with cloud storage connections.

Walkthrough

The change adjusts the minimum listings_expiry_time for AzureBlobFileSystem initialization from 0 to 1 to prevent directory cache expiry between write and read operations, replacing a previous workaround with clarifying documentation.

Changes

Cohort / File(s) Summary
AzureBlobFileSystem Configuration
unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py
Adjusted minimum listings_expiry_time from 0 to 1 for AzureBlobFileSystem initialization to prevent DirCache expiry between consecutive write and read operations, with updated comment referencing the related issue.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the specific regression fix (Azure listings_expiry_time) and its source (PR #1826), accurately summarizing the main change.
Description check ✅ Passed The description is comprehensive and follows the template with all required sections filled, including detailed context on the regression cause and testing guidance.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/azure-listing-expiry

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@chandrasekharan-zipstack chandrasekharan-zipstack changed the title Fix Azure listings_expiry_time regression from PR #1826 [MISC] Fix Azure listings_expiry_time regression from PR #1826 Mar 10, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py (1)

42-51: Consider making the cache requirement explicit for resilience.

The regression fix correctly pins listings_expiry_time=1, which resolves the KeyError('/') caused by an expiry time of 0. However, the code omits use_listings_cache and relies on the fsspec default. Since your comment explicitly documents that use_listings_cache=False would trigger the same failure, consider adding use_listings_cache=True explicitly to decouple correctness from library defaults.

♻️ Suggested enhancement
         self.azure_fs = AzureBlobFileSystem(
             account_name=account_name,
             credential=access_key,
+            use_listings_cache=True,
             listings_expiry_time=1,
         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py`
around lines 42 - 51, The AzureBlobFileSystem instantiation currently sets
listings_expiry_time=1 to avoid a KeyError but leaves use_listings_cache to the
fsspec default; explicitly pass use_listings_cache=True when creating
AzureBlobFileSystem (the azure_fs assignment / AzureBlobFileSystem(...) call) so
the behavior is not dependent on upstream defaults and update the surrounding
comment to note that use_listings_cache must be True for resilience.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py`:
- Around line 42-51: The AzureBlobFileSystem instantiation currently sets
listings_expiry_time=1 to avoid a KeyError but leaves use_listings_cache to the
fsspec default; explicitly pass use_listings_cache=True when creating
AzureBlobFileSystem (the azure_fs assignment / AzureBlobFileSystem(...) call) so
the behavior is not dependent on upstream defaults and update the surrounding
comment to note that use_listings_cache must be True for resilience.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b4c46465-12fe-4e25-a358-8c8a2cfe4ba9

📥 Commits

Reviewing files that changed from the base of the PR and between 410055f and bcad88d.

📒 Files selected for processing (1)
  • unstract/connectors/src/unstract/connectors/filesystems/azure_cloud_storage/azure_cloud_storage.py

Copy link
Copy Markdown
Contributor

@gaya3-zipstack gaya3-zipstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok for now. Approving with the understading that this may not fix all the problems.

@gaya3-zipstack gaya3-zipstack merged commit d645846 into main Mar 10, 2026
7 checks passed
@gaya3-zipstack gaya3-zipstack deleted the fix/azure-listing-expiry branch March 10, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants