-
-
Notifications
You must be signed in to change notification settings - Fork 329
Improve async handling for s3fs #2901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What happens if your application code closes the filesystem (does s3fs offer an async with context? I don't remember)? async with fs:
store = zarr.storage.FsspecStore(fs, path="/mybucket/myzarr.zarr")
dataset = xarray.open_zarr(store, zarr_format=3) The tricky bit here is that zarr-python doesn't really know who owns the filesystem passed into Maybe we could make |
s3fs actually has a custom finalizer that should close these sessions in some cases Although it looks like that is not used for asynchronous filesystems. |
I'm guessing this is the same error I'm seeing, even though I'm using import zarr
import s3fs
s3 = s3fs.S3FileSystem(profile="PROFILE", asynchronous=True)
store = zarr.storage.FsspecStore(s3, path=f"/mybucket/myzarr.zarr")
z = zarr.open(store, mode="r") which produces:
|
Yep to me it's the same error. |
I have a similar issue, but mine only seems to pop up, when I use a role to authenticate, when my credentials are saved in All I need to do to reproduce the errors is: group = zarr.open_group("s3://path-to-zarr") |
Zarr version
v3.X
Numcodecs version
v0.15.1
Python Version
3.12
Operating System
Linux
Installation
pip into venv
Description
When opening a zarr using s3fs, some errors related to
aiohttp
objects are raised when leaving the Python interpreter. From what I understand, it seems that cleaning asynchronous objects should be performed by the filestorage implementation, as in #2674 (comment).However it is unclear to me if this should be performed by zarr_python or the s3fs implementation, as discussed here : fsspec/s3fs#943.
What do you think ?
Steps to reproduce
Should raise the following error :
Additional output
No response
The text was updated successfully, but these errors were encountered: