add http client timeout option to raw config provider #418
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the base http client is always initialized with a
defaultTimeout
of 1 minute. This value cannot be overriden.A timeout of 60 seconds is not sufficient when using the
objectstorage
package to upload blobs larger than a few gigabytes. The user should be able to set the timeout value depending on their use case. For example, we're uploading image builds with sizes of a few gigabytes. A timeout of 60 seconds is not enough to complete the upload request.This PR adds an HTTP timeout config option to the raw config provider. It was implemented with the option function pattern as to not break the public API while adding new options.
A small internal
httpConfigurationProvider
interface was introduced to prevent a larger change of extending the config provider interface. There are many config provider implementations that would have need to changed if we extended the main interface. Doing it this way we introduce only the minimal amount of changes needed to implement the behavior we want.Added unit tests to verify the correct behavior of the extended raw config provider implementation.
We're already using this patch internally in our codebase. Please merge it so we can follow upstream directly again.
The commit is signed of as per
CONTRIBUTING.md
.