-
Notifications
You must be signed in to change notification settings - Fork 1k
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(artifacts): update to okhttp3 and add connection timeout config for github artifacts. #5093
base: master
Are you sure you want to change the base?
Conversation
gsapkal
commented
Nov 10, 2020
•
edited
Loading
edited
- The artifact provider is updated to use okHttp3 provided by kork-web.
- For artifact configuration added attributes connectTimeoutMs, readTimeoutMs and retryOnConnectionFailure. These will be used to configure okhttp3 used by http based artifact providers.
- For github artifact provider connectTimeoutMs, readTimeoutMs and retryOnConnectionFailure attributes are added. If defined the okhttp3 client used by github provider will be configured using these.
- For gitrepo artifact provider timeout attribute is added account configuration which will be used to configure jgit timeout.
… configuration . ##Clouddriver artifacts downloader settings. artifacts: connectTimeoutMs: 1200000 readTimeoutMs: 1200000 retryOnConnectionFailure: true
… github artifacts.
Let's chat before this gets merged. We should actually be using https://github.com/spinnaker/kork/blob/master/kork-web/src/main/groovy/com/netflix/spinnaker/config/OkHttp3ClientConfiguration.groovy We have recently been talking about switching to the single okhttp instance model because it's recommended by the library. Are you in the OSS slack? |
@zachsmith1 I explored the option of using the config from kork but it seems to be specific to spinnaker micro-services communication specific. With external systems for artifacts download the values might be different based on endpoints and network we are hitting. we can discuss this more on OSS slack. |
…entConfigurationProperties
ArtifactConfiguration now doesnt need to provide OkHttpClient bean . Adding it as dependency for now.
@Bean | ||
OkHttpClient okHttpClient() { | ||
return new OkHttpClient(); | ||
@JsonIgnore private final OkHttpClient okHttpClient; |
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.
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.
@zachsmith1 @dreynaud I have tested updated this code to keep the okHttpClient bean. Also updated PR to support the timeout as part of gitrepo account configuration.
Please review and let me know if there are any changes needed.
CC'ing @srekapalli and @cfieber who probably have more recent experience with this |
@Bean | ||
OkHttpClient okHttpClient() { | ||
return new OkHttpClient(); |
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.
Base client is already configured here kork-web and we should be able to inject this and customize further for timeout settings etc using the newBuilder
api.