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
feat: [object-store] re-export hyper #5389
base: master
Are you sure you want to change the base?
Conversation
object_store/src/export.rs
Outdated
@@ -0,0 +1,3 @@ | |||
//! Re-exports of libraries used by `object_store`. |
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.
You will need to add the license goop at the top to make CI happy
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.
Ah, right.
object_store/src/lib.rs
Outdated
@@ -497,6 +497,7 @@ pub use tags::TagSet; | |||
pub mod multipart; | |||
mod parse; | |||
mod util; | |||
pub mod export; |
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.
Is this a convention found in other crates, or do they re-export at the root?
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.
Could not really find a convention. In this book it is done in the root: https://www.lurklurk.org/effective-rust/re-export.html
Which should work fine for hyper
, but might give you some collisions if a library has a name colliding with internal modules. No preference on my side. Shall I do it from root?
So I did some digging because reqwest, which is the client we are actually using, doesn't export hyper and I wondered why. I think it is something to do with the way that reqwest supports wasm32. This isn't an immediate issue, given wasm32 for HTTP stores is currently incomplete, but it does make me wonder if this is the correct way to go about this. Perhaps something like #5345 might be what you are looking for? |
Which is an object-store variant of hyper/http errors? Seems also good. Since |
Yes, and have tests that should catch any divergence. It is not an ideal situation, but it has worked so far |
In that case, I would love to piggy back on that via an export. 😜 |
Perhaps you might expand upon your use-case for downcasting the errors? It occurs to me that this is somewhat breaking encapsulation, and we might be able to expose this information in a better way, perhaps?? |
I want to get most information out of the errors and see how to handle upon those. I haven't got a clear answer to what exactly my solution is. But having access to the http errors for accessing s3 is very important to us as I want to be close to maximum concurrency without triggering those. We want to be very fast here and like to be able experiment with tuning settings. Ideally I want to dynamically tune the client settings later.
Why? We can already get the hyper error out. It is only more painful now because we need to match the exact version. It is the same argument for your usage with |
Because there is no requirement that all or even any ObjectStore are implemented using hyper, and in fact we already have some that are not 😅. I accept that power users may want to tinker, but I guess I'm wondering if we really want to be encouraging this by making it a first-party API.
Perhaps you could identify from the list of errors exposed by S3 what variant you are interested in intercepting. We automatically backoff on receiving a 503, which is what it will return if you exceed the maximum concurrency (unless you are really hammering it in which case it will just drop the connections). |
I totally understand that. And I as a user am willing to pay that breaking change risk. ;) So we could
I don't know yet. I always learn while tinkering. 😅. It isn't a joke, I cannot answer what I need exactly yet. Have to learn this as we go. If we have found something that works good for us, we can push that back into object-store. I rather have that handled higher up. |
In that case, how about we mark this PR as a draft, and revisit this once we have a better idea of the concrete use-cases for this feature? |
Sure, fine by me. 👍 |
Closes #5386
Are there any user-facing changes?
No