-
Notifications
You must be signed in to change notification settings - Fork 104
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
should adlfs be responsible for the event loop management for threads? #218
Comments
@isidentical -- thanks for bringing this forward. Do you know if it started after #198 ? Tagging @martindurant to find out if this is just an issue with adlfs or if it impacts other packages that use fsspec. |
I don't know for sure, but don't think so it is related with that. |
What version of fsspec are you running against here? |
I think it is not related with fsspec, since both |
@martindurant -- It's fsspec == 2021.4.0, and after spending a little more time on it, I agree with @isidentical that the issue seems to be related to the Azure sdk implementation. For me,, when calling With a LocalCluster or a remote cluster, it works as expected. It appears that, with a distributed Client running, the Azure library can access a loop running in the distributed cluster's thread. Setting the loop in do_connect() as
fixes the example given above, but, as pointed out in the dvc PR, it doesn't fix the |
Since fsspec is for sure around, feel free to reuse its loop in its thread for all IO, which should make you immune to how dask happens to be running. fsspec sets things up here, unless a loop is specified to AsyncFileSystem or asynchronous=True. |
get_loop() is used in adlfs, and works well. I'm trying to understand if #197 contributes to the issue. If I revert back to:
it eliminates the above example, but still does not fix the |
Exactly - fsspec now has exactly one loop in a specific thread, as it used to, whereas for a brief while it had one loop for each thread. You can use fsspec's
|
Thanks! That was the piece I needed. Appreciate the input! |
This should be fixed by #229 |
Here is an example where it fails with "there is no set event loop for thread: blablah"
The cause of this issue is that, the
thread
doesn't have any event loop set butAzureBlobFileSystem.do_connect()
tries to instantiate classes that requires access to set event loops (e.gAIOBlobServiceClient
).This is something that can be easily solved via
asyncio.new_event_loop
/asyncio.set_event_loop
though I am a bit unsure about whether the client should manage this or shoulddo_connect
inAzureBlobFileSystem
get a special condition for this case and manage event loop by itself for threads that don't have one.The text was updated successfully, but these errors were encountered: