Skip to content

Commit 7e96e66

Browse files
Added note about refresh and POSIX behavior (#648)
Co-authored-by: Martin Durant <[email protected]>
1 parent 7b9ef9c commit 7e96e66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gcsfs/core.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,14 @@ class GCSFileSystem(asyn.AsyncFileSystem):
210210
GCSFileSystem maintains a per-implied-directory cache of object listings and
211211
fulfills all object information and listing requests from cache. This implied, for example, that objects
212212
created via other processes *will not* be visible to the GCSFileSystem until the cache
213-
refreshed. Calls to GCSFileSystem.open and calls to GCSFile are not effected by this cache.
213+
refreshed. Calls to GCSFileSystem.open and calls to GCSFile are not affected by this cache.
214+
215+
Note that directory listings are cached by default, because fetching those listings can be expensive. This is
216+
contrary to local filesystem behaviour. The cache will be cleared if writing from this instance, but it can
217+
become stale and return incorrect results if the storage is written to from another process/machine.
218+
If you anticipate this possibility, you can set the use_listings_cache and listings_expiry_time arguments
219+
to configure the caching, call `.invalidate_cache()` when required, or pass `refresh=True` to the
220+
various listing methods.
214221
215222
In the default case the cache is never expired. This may be controlled via the ``cache_timeout``
216223
GCSFileSystem parameter or via explicit calls to ``GCSFileSystem.invalidate_cache``.

0 commit comments

Comments
 (0)