-
Notifications
You must be signed in to change notification settings - Fork 777
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
Retry Calls on HTTP 5XX Response Status Codes #210
Comments
Ya I have seen this a few times as well, adding some very basic retries would be good. We might want to consider putting in some kind of circuit breaker with that many objects as this could easily contribute to being rate limited with a small outage once its over and being left in an odd in between state. |
The number of failures we've been getting due to these random 502s is steadily increasing. Now every plan takes 3-5 attempts before we get lucky. |
I reached out to GitHub support, and they mentioned that having the |
@captn3m0 that sounds like a great enhancement! It should probably be added as a top level feature request so it doesn't get lost in here since they would likely require two different implementations. 👍 |
I recently had a failure due to a 503 error. Due to API limits, we're using read delay and write delay which means that plans can take a long time to run. A single 503 error requires that the plan run again, taking up additional time that is better spent on other things. An HTTP call retry would be a very valuable feature. |
Funny thing, ChatGPT things it is already implemented:
|
In order to address the issue integrations#210 I have added 3 new parameters to the provider - retry_delay_ms - max_retries - retryable_errors In case max_retries is > 0 (defaults to zero) it will retry the request in case it is an error the retryable_errors defaults to [500, 502, 503, 504] It retries after the ms specified in retry_delay_ms (defaults to 1000)
* Add retryable transport for errors In order to address the issue #210 I have added 3 new parameters to the provider - retry_delay_ms - max_retries - retryable_errors In case max_retries is > 0 (defaults to zero) it will retry the request in case it is an error the retryable_errors defaults to [500, 502, 503, 504] It retries after the ms specified in retry_delay_ms (defaults to 1000) * Update documentation with new parameters for retry * Change default of max_retries to 3 * Fix typo in naming * Update github/transport_test.go * Add error check for data seek * Consolidate the default retriable errors on a function * Fix typo on the comments Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Update vendor * Fix merging conflicts * Update documentation with new parameters for retry * Change default of max_retries to 3 * Fix typo in naming * Add error check for data seek * Update github/transport_test.go * Consolidate the default retriable errors on a function * Fix typo on the comments Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Don't run go mod tidy on release (#1788) * Don't run go mod tidy on release * Be more specific about releases * Fix lint with APIMeta deprecation --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
* Add retryable transport for errors (#1704) * Add retryable transport for errors In order to address the issue #210 I have added 3 new parameters to the provider - retry_delay_ms - max_retries - retryable_errors In case max_retries is > 0 (defaults to zero) it will retry the request in case it is an error the retryable_errors defaults to [500, 502, 503, 504] It retries after the ms specified in retry_delay_ms (defaults to 1000) * Update documentation with new parameters for retry * Change default of max_retries to 3 * Fix typo in naming * Update github/transport_test.go * Add error check for data seek * Consolidate the default retriable errors on a function * Fix typo on the comments Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Update vendor * Fix merging conflicts * Update documentation with new parameters for retry * Change default of max_retries to 3 * Fix typo in naming * Add error check for data seek * Update github/transport_test.go * Consolidate the default retriable errors on a function * Fix typo on the comments Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Don't run go mod tidy on release (#1788) * Don't run go mod tidy on release * Be more specific about releases * Fix lint with APIMeta deprecation --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com> * fix: remove repository topic from state if it doesnt exist in GitHub anymore (#1918) * remove repository topic if they cannot be found in GitHub anymore * Fix build error by bumping package version in offending file --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Bump version to v6 (#2106) * Upgrade to Terraform Plugin SDK v2 (#1780) * go mod tidy -go=1.16 && go mod tidy -go=1.17 * Run go mod vendor * Attempt v2 upgrade * Plugin compiling * Fix some provider test errors * Fix test compilation error * ValidateFunc --> ValidateDiagFunc * Fix casing * Sprinkle toDiagFunc everywhere * More fixes for validation functions * State --> StateContext * %s --> %v when printing diags * ConfigureFunc --> ConfigureContextFunc * Checking results of d.Set, round one * Continue checking d.Set results * Check results of d.Set, round three * Checking d.Set results, round four * d.Set round five * In tests, export GITHUB_TEST_ORGANIZATION * Remove unnecessary MaxItems on computed value * Go build now works * Resolve linting errors * Apply diag.FromErr twice more * Pass key names into toDiagFunc helper * Construct cty.Path from strings * Tests now working * Update terraform-plugin-sdk version * Remove commented attribute setting in resource_github_team.go * Fix restrict pushes on github_branch_protection. Fix branch protection tests (#2045) * Update restrict pushes. Fix branch protection tests Change blocks_creations default to true. Fix broken build. * add state migration * rename push_restrictions to push_allowances * correct state migration issue * add docs clarification * update migration func args * fix test args * cleanup tests * Pass context.Background() in test * fix timestamp fields --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Set group_id correctly (#2133) * Run go get -u github.com/golangci/golangci-lint * Separate github_team_members import from github_team as create_default_maintainers is not defined for members resource (#2126) Co-authored-by: Keegan Campbell <me@kfcampbell.com> * Add missing variable definition for test case --------- Co-authored-by: Daniel França <github.t6297kgphp.dv@koderama.com> Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Co-authored-by: Felix Luthman <34520175+felixlut@users.noreply.github.com> Co-authored-by: georgekaz <1391828+georgekaz@users.noreply.github.com> Co-authored-by: Rich Young <richjyoung@users.noreply.github.com>
👋 Hey Friends, this issue has been automatically marked as |
Terraform Version
Affected Resource(s)
In our use case, mainly:
github_issue_label
Terraform Configuration Files
Debug Output
Issue is intermittent, can provide if necessary.
Expected Behavior
The Terraform resource should retry the HTTP request on retryable HTTP response status codes (e.g. 5XX).
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
The Terraform state above has 2600+
github_issue_label
resources. (Occurs more often on larger amounts ofgithub_issue_label
resources.)References
The text was updated successfully, but these errors were encountered: