argocd: use native http client, apply fallback on sync timeout, local ITs instance script #193
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.
Use Java's native
HttpClient
instead of Apache's.Streamline dependencies. Less stuff to manage over time.
Apply
syncTimeout
to entireCallRetry
operation.Previously, the timeout was implicitly applied through the http call made within. This could result in a duration up-to
retryCount * syncTimeout
--say, if the operation was interrupted 59 minutes into a 60 minutes timeout, then a retry would be given at least another 60 minute window. ArgoCD's sync call is essentially a single long-runningGET
call. SinceCallRetry
is currently only used for that purpose, the reliance on a socket timeout worked "good enough"--assuming the call wasn't interrupted by something other than aSocketTimeout
.This PR's change to
CallRetry
forces a timeout against the operation as a whole, so if for some odd reason the http's socket timeout doesn't occur, it will still effectively timeout as expected. This further makes the class more reusable for in the future.Apply "fallback" calls after timeout of "main" call in
CallRetry
Previously, if the main call timed out, then that immediately was the end of things. Now, the fallback call(s) are made in the case of a main call timeout.
Local integration tests
Added script and Ansible playbook to bootstrap a local ArgoCD instance for integration testing. See details in README.md