-
Notifications
You must be signed in to change notification settings - Fork 362
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
WIP: Remove nested async by copying code #581
Conversation
Documentation will need to be very clear about about to write an async implementation. cf fsspec/gcsfs#363 , which still fails due to a nested sync call somewhere. cc @mrocklin - this should make calling async things much more robust. |
@martindurant -- Want to be sure I'm clear. No calls from async code to sync code, correct? |
I'm happy to see this :) @hayesgb LMK if you need a hand on the adlfs side of things. |
Specifically: async code cannot call sync code that calls async code. In other news... |
@hayesgb @TomAugspurger - probably should include adlfs in the list of things that get tested here, as s3fs and gcsfs already are. That would be a separate PR. |
Agreed. I’m covered up with other stuff at the moment, and I’m sure this was impacting memory usage when calling .close() on the File object, which prompted a direct call to asyncio in the current master branch.
@TomAugspurger - if you have time to jump in that would be great. I was hoping to do a 0.7 release soon...
… On Mar 24, 2021, at 7:49 AM, Martin Durant ***@***.***> wrote:
@hayesgb @TomAugspurger - probably should include adlfs in the list of things that get tested here, as s3fs and gcsfs already are. That would be a separate PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Sounds good. I'll take a look at this today. |
Locally, I see three failures from the adlfs test suite, but those three failures are also present on fsspec master. At a glance, some look related to "directory" handling, which I think is discussed in #562. If needed I can bisect fsspec to the commit where things started failing (they pass with 0.8.7) but I'm guessing it's already known. |
Sounds good, @TomAugspurger - let's cover that in the separate issue, then. |
I’m going to execute a release of adlfs. Based on this discussion, I’ll pin fsspec<=0.8.7, with the intention to remove the pin once this is resolved. |
Major change to async code!
All nested calls to sync removed, by copying code such as walk() from spec to asyn. All async method only call async methods, and an attempt to do otherwise raises NotImplemented. In fact, _run_until_complete is gone. This is how it should have been written from the start (except that some copied code could clearly be factored out).
cc @hayesgb , this surely affects azure
s3fs and gcsfs already have conforming code locally I will push when we agree on this change.