Add option to cache unknown bucket type#844
Open
Yonghui-Lee wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #844 +/- ##
==========================================
+ Coverage 88.52% 88.56% +0.03%
==========================================
Files 15 15
Lines 2989 2990 +1
==========================================
+ Hits 2646 2648 +2
+ Misses 343 342 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zhixiangli
reviewed
May 13, 2026
| - retry_multiplier: Multiplier for delay between retries. | ||
| These map to `google.api_core.retry.AsyncRetry` arguments (without 'retry_' prefix). | ||
| """ | ||
| self._cache_unknown_buckets = kwargs.pop("cache_unknown_buckets", False) |
Collaborator
There was a problem hiding this comment.
If a user sets _cache_unknown_buckets to true and has the required permissions, is the result still cached when a transient error occurs? Could we check if it is a permission error / cache with a TTL, allowing for access to be granted later? WDYT?
6adac07 to
65c0c9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
cache_unknown_bucketsconfiguration option to allow caching ofUNKNOWNbucket type .Currently,
ExtendedGcsFileSystemattempts to detect bucket types (zonal, HNS, etc.) using the Storage Control API. If a user lacks permissions for this API (or when using an emulator that doesn't support it), the lookup fails and the bucket type falls back toUNKNOWN.Since
UNKNOWNtypes are not cached by default, every subsequent operation on the bucket triggers another failing API call, causing significant performance degradation due to repeated slow lookups.