-
Notifications
You must be signed in to change notification settings - Fork 622
Open
Labels
coreenhancementNew feature or requestNew feature or requestreleases-note/featThe PR implements a new feature or has a title that begins with "feat"The PR implements a new feature or has a title that begins with "feat"services/fs
Description
Feature Description
I notice when we create an operator for local filesystem, it actually issues sync IO requests.
opendal/core/src/services/fs/backend.rs
Lines 90 to 100 in b53d802
// If root dir is not exist, we must create it. | |
if let Err(e) = std::fs::metadata(&root) { | |
if e.kind() == std::io::ErrorKind::NotFound { | |
std::fs::create_dir_all(&root).map_err(|e| { | |
Error::new(ErrorKind::Unexpected, "create root dir failed") | |
.with_operation("Builder::build") | |
.with_context("root", root.to_string_lossy()) | |
.set_source(e) | |
})?; | |
} | |
} |
While all other operations are async (i.e., read, write, etc), people are likely to use Operator
in an async runtime, would be better if operation build is also async.
Problem and Solution
Proposed solution:
- Make operator creation async, essentially use async IO syscalls.
- But it's a breaking behavior and API change, likely we will add another async interface.
Additional Context
No response
Are you willing to contribute to the development of this feature?
- Yes, I am willing to contribute to the development of this feature.
dosubot and machichima
Metadata
Metadata
Assignees
Labels
coreenhancementNew feature or requestNew feature or requestreleases-note/featThe PR implements a new feature or has a title that begins with "feat"The PR implements a new feature or has a title that begins with "feat"services/fs