-
Notifications
You must be signed in to change notification settings - Fork 213
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
Make S3 (and other libraries) take an interface for HTTP client #354
Comments
Thanks @stevvooe . |
@alimoeeny We generally vendor everything, so I am not worried about broken builds. It seems like maintaining backwards compatibility should be mostly possible, except for the broken timeout configuration options (since they will be ignored). Let me know how you'd like to proceed. |
Fair enough, @stevvooe |
@alimoeeny Further research shows that the 30ms connection overhead isn't the biggest bottleneck when making round trips to s3. I'm not sure if it changes this ticket but it does affect the priority of the fix. |
Right now, we are using the s3 library and it is making a new connection for each request, leading to performance issues. The main issue is that a new transport is created each time a method is called on
S3
. The dialer implementation here is probably the source of a lot of problems seen with this library, as well. Compare that with thenet/http.DefaultTranport
configuration.By default, the library should just leverage the default transport. Let's par down the cleverness and just allow an http.Client to be passed into
s3.New
. Remove theConnectTimeout
andReadTimeout
from theS3
struct, as well. These are breaking the abstraction.Ideally, these libraries should just take an interface like this:
If you are amenable to this approach, we can submit a PR.
The text was updated successfully, but these errors were encountered: