-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Use resource.Retry for route creation and deletion #6225
Conversation
@@ -152,7 +155,27 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { | |||
log.Printf("[DEBUG] Route create config: %s", createOpts) | |||
|
|||
// Create the route | |||
_, err := conn.CreateRoute(createOpts) | |||
var out *ec2.CreateRouteOutput |
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.
it doesn't look like we use out
here; it's used in conn.CreateRoute
but then never after that, safe to remove?
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.
Yeah, good catch, was just an artifact of copy/pasting.
Looks solid! Can you give me an example of an Thanks! |
I believe the specific case I was running into was due to eventual consistency with route table creation (so RouteTableId) was invalid. The weird part was that when I went to I'm not 100% sure that this is what was happening, but it looked very much like a race-condition/eventual-consistency issue. I was seeing failures about 80% of the time without this change. Sorry for the voodoo-style analysis, but I wasn't able to get a lot of debugging information about the error. Since running with the change locally, I haven't seen the failure over the course of 10s of runs. |
That's cool, I was just curious if you knew off hand what kind of things would happen there |
acc tests pass, merging, thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Retry logic for creation/deletion of
aws_route
resources. The retry structure is cribbed from https://github.com/hashicorp/terraform/pull/3061/files. Not sure if there's a good way to test this, but it appears to correct the intermittent failure I was seeing when creating routes across peered VPCs.