Skip to content

Commit

Permalink
Retry on InvalidRouteTableID.NotFound, to work around race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Jun 29, 2021
1 parent c2db282 commit 7d0ddb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/modules/ec2_vpc_route_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,9 @@ def main():
['state', 'present', ['vpc_id']]],
supports_check_mode=True)

retry_decorator = AWSRetry.jittered_backoff(retries=10)
# The tests for RouteTable existing uses its own decorator, we can safely
# retry on InvalidRouteTableID.NotFound
retry_decorator = AWSRetry.jittered_backoff(retries=10, catch_extra_error_codes=['InvalidRouteTableID.NotFound'])
connection = module.client('ec2', retry_decorator=retry_decorator)

state = module.params.get('state')
Expand Down

0 comments on commit 7d0ddb0

Please sign in to comment.