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
Implement retry on transient errors #53
Implement retry on transient errors #53
Conversation
Co-authored-by: Lawrence Gripper <info@grippers.co.uk>
…ound. Co-authored-by: Stuart Leeks <stuart@leeks.net>
Handle empty lines Handle lines starting with Handle final line not having a newline Handle spaces in values
Co-authored-by: Lawrence Gripper <info@grippers.co.uk>
…ound. Co-authored-by: Stuart Leeks <stuart@leeks.net>
Handle empty lines Handle lines starting with Handle final line not having a newline Handle spaces in values
8937b12
to
2c133a1
Compare
@stikkireddy - have rebased this on master now that you have merged #51 |
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
==========================================
- Coverage 49.10% 48.93% -0.18%
==========================================
Files 44 44
Lines 5908 5902 -6
==========================================
- Hits 2901 2888 -13
- Misses 2959 2963 +4
- Partials 48 51 +3
|
161079d
to
478d0d2
Compare
478d0d2
to
fc395f4
Compare
I've fixed up the build. I'd like to run another local test of the full integration test suite to check there isn't anything I've missed along the same lines. |
Looks like this is behaving nicely when testing with Unrelated: Should I update |
This looks good to me @lawrencegripper I will integrate this into make terraform-acc-azure as part of the travis-ci branch to be able to run these tests along with the aws during merge to master. But if you would like to make the changes in this PR please go right ahead. Just let me know if this is ready for me to test & merge. |
I think thats the incorrect issue number/pr number please let me know if that is the case @stuartleeks. Issue #55 is a potential nil pointer panic due to not verifying if the pointer is not nill. |
Oops! That's also not relevant now, so will just remove it! |
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.
Just a comment/thought wanted your thoughts on removing a few additional lines in the azure_auth file.
@stikkireddy re the travis integration, it looks like you have that underway in another PR? If so, would you be happy to merge this PR and pick up the integration in the other PR? |
Awesome this looks great to me! Thanks for the contribution! Merging this in. |
As discussed in #33, there are cases where the API endpoint returns errors such as
"Succeeded{"error_code":"INVALID_PARAMETER_VALUE","message":"Unknown worker environment WorkerEnvId(workerenv-4312344789891641)"}
.These errors have been observed shortly after a workspace has been created. Additionally, we have seen these errors after successful API calls, so simply waiting for a successful API response isn't sufficient.
The PR changes the
service.DBApiClientConfig
to use retryablehttp.Client instead of the standardhttp.Client
. HTTP responses with a status code >= 400 and where the message contains any of the strings identified in #33 are treated as retryable errors.We included logging, so if
TF_LOG=debug
is set then the log output will includeFailed request detected: Retryable type found. Attempting retry...
when a retryable error is encountered.@lawrencegripper has run a number of test deployments where we have seen this output, demonstrating that the retry logic is kicking in.