-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add Exponential Backoff When adding Heroku Domain #71
Comments
Proposed solution will be add some exponential backoff potentially. |
I ran into a form of this the other week as well. In my case the app already existed in the statefile, but I was adding a The aws provider client has some built-in retry/backoff mechanism, we might look to see if that can be extracted. I've also use https://github.com/cenkalti/backoff before, but I would like to get some additional 👀 on it to see if that looks like a dependency we want to bring in. Ideally, I'd like to see retry logic built into the client, that way we get this for free across all our API calls and don't have to retrofit retry logic everywhere. I'll open a discussion in https://github.com/heroku/heroku-go. |
Actually perhaps the right thing to do here is use this: https://godoc.org/github.com/hashicorp/terraform/helper/resource#StateRefreshFunc |
I think using StateRefreshFunc is the more appropriate solution for this case, rather than baking retries into the client. |
Agreed, the more I think about it the more that seems like the right thing to do. |
@talbright Thinking about this more, I think the refresh should be done on the app after creation. By waiting there for the app to be ready, we would also fix https://github.com/terraform-providers/terraform-provider-heroku/issues/37 and anything else which depends on the app being provisioned for resources to be added. It would be a smarter version of the work-around that we've been using of introducing a sleep after app creation (https://github.com/terraform-providers/terraform-provider-heroku/issues/37#issuecomment-356378747). |
That makes sense to me as well. There's an issue with a couple of tests, I'm waiting to hear back from @davidji99 on and get those cleared out. If this hasn't been worked on by the time I get that cleaned up, I will implement the fix suggested here on the app resource. |
Hitting this up next. |
@bernerdschaefer I don't see anything in the production API for checking app status. I could hit the webhook API and look for past events, but that seems dodgy. There's a status field for the domain endpoint (https://devcenter.heroku.com/articles/platform-api-reference#domain) but that wouldn't fix the original issue here:
Now I can fix this in the heroku resource by greping for this error message. That would not however fix if for the broader scenerios we have discussed here. |
Addressed by #142 |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Output
heroku_domain.app: 1 error(s) occurred:
Expected Behavior
It should wait until the app completes provisioning before trying to apply the domain change
Actual Behavior
Failed apply
The text was updated successfully, but these errors were encountered: