-
Notifications
You must be signed in to change notification settings - Fork 839
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
Remove Nested async and Fallibility from ObjectStore::list #4930
Conversation
@@ -1158,21 +1156,14 @@ mod tests { | |||
|
|||
let store = LocalFileSystem::new_with_prefix(root.path()).unwrap(); | |||
|
|||
// `list` must fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer have this peculiar arrangement where an error can emerge in two different places
let result: Vec<_> = integration | ||
.list(prefix) | ||
.await | ||
.unwrap() | ||
.try_collect() | ||
.await | ||
.unwrap(); | ||
let result: Vec<_> = integration.list(prefix).try_collect().await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much nicer imo
object_store/src/limit.rs
Outdated
let s = self.inner.list_with_offset(prefix, offset); | ||
let fut = Arc::clone(&self.semaphore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This somewhat peculiar ordering is required because the returned stream cannot borrow prefix, only self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tustvold this seems reasonable. I'd be +1 on this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this is a nicer interface than an async function that returns a stream
3246471
to
f4dcb53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Should we have an issue for this?
|
I think this means we need to release another SemVer change for object_store on the next release |
Indeed, there are already also some other breaking changes already merged and some others in the pipeline |
I wonder if it was intended that It seems a strangely different API https://docs.rs/object_store/latest/object_store/trait.ObjectStore.html#tymethod.list_with_delimiter |
Yes it was intended as list_with_delimiter does not return a stream |
BTW I think this change has also made it somewhat harder to implement "fail fast" semantics for object store clients, something we saw in IOx and @andygrove noticed while updating ballista slack reference: https://the-asf.slack.com/archives/C01QUFS30TD/p1702312372903249 |
The following should do the trick
|
I ended up with the following to resolve this: stream::once(async { Err(...) }).boxed() |
Which issue does this PR close?
Closes #4946.
Rationale for this change
Having two layers of asynchrony and fallibility makes for a rather obnoxious interface. Removing this makes for better client ergonomics, at the expense of slightly more arcane logic to implement the ObjectStore
What changes are included in this PR?
Are there any user-facing changes?