terraform/builtin/providers
Paul Hinze 6b6b5a43c3 provider/aws: serialize SG rule access to fix race condition
Because `aws_security_group_rule` resources are an abstraction on top of
Security Groups, they must interact with the AWS Security Group APIs in
a pattern that often results in lots of parallel requests interacting
with the same security group.

We've found that this pattern can trigger race conditions resulting in
inconsistent behavior, including:

 * Rules that report as created but don't actually exist on AWS's side
 * Rules that show up in AWS but don't register as being created
   locally, resulting in follow up attempts to authorize the rule
   failing w/ Duplicate errors

Here, we introduce a per-SG mutex that must be held by any security
group before it is allowed to interact with AWS APIs. This protects the
space between `DescribeSecurityGroup` and `Authorize*` / `Revoke*`
calls, ensuring that no other rules interact with the SG during that
span.

The included test exposes the race by applying a security group with
lots of rules, which based on the dependency graph can all be handled in
parallel. This fails most of the time without the new locking behavior.

I've omitted the mutex from `Read`, since it is only called during the
Refresh walk when no changes are being made, meaning a bunch of parallel
`DescribeSecurityGroup` API calls should be consistent in that case.
2015-11-18 12:39:59 -06:00
..
atlas Remove no-op Updates from resource schemas 2015-10-03 14:29:19 -07:00
aws provider/aws: serialize SG rule access to fix race condition 2015-11-18 12:39:59 -06:00
azure provider/azure: read publish_settings as contents instead of path 2015-11-16 17:47:56 -06:00
cloudflare providers/cloudflare: if resource no longer exists, set ID to "" 2015-06-28 23:28:12 -07:00
cloudstack Add `computed` flag to the `network_domain` parameter 2015-10-23 09:54:54 +02:00
consul
digitalocean Logging that the DO droplet wasn't found before removing it 2015-11-05 17:32:57 +00:00
dme Use cleanhttp for new http clients 2015-10-22 14:23:59 -04:00
dnsimple “DNS Simple” should be “DNSimple” 2015-07-17 23:18:28 -04:00
docker removed extra parentheses 2015-10-08 15:48:04 +03:00
dyn add Mutex so that we only do one Dyn operation at a time (extra thanks to @daveadams) 2015-09-21 10:01:32 -04:00
google provider/google: read credentials as contents instead of path 2015-11-16 15:14:32 -06:00
heroku Switch to go-multierror 2015-09-27 18:58:48 -07:00
mailgun
null Merge pull request #3244 from Banno/make-null-resource-more-useful 2015-10-27 13:30:54 -05:00
openstack openstack: fix go vet error (bool modifier is %t) 2015-11-14 08:19:22 +00:00
packet Populate the provisioner connection info for packet.net devices with the ipv4 public address 2015-11-16 21:02:57 -08:00
rundeck gofmt files from recently merged PRs 2015-10-07 13:35:06 -07:00
template template_file: source contents instead of path 2015-11-13 11:24:20 -06:00
terraform
tls tls provider 2015-10-22 21:48:32 -07:00
vsphere Merge pull request #3717 from rakutentech/improve-acceptance-test 2015-11-05 13:07:20 -06:00