upbound / provider-terraform

A @crossplane provider for Terraform
Apache License 2.0
124 stars 55 forks source link

Make the terraform harness only use the rwmutex if the plugin cache is enabled #240

Closed toastwaffle closed 4 months ago

toastwaffle commented 5 months ago

Description of your changes

As discussed in #239, this makes the terraform harness only take the lock if the plugin cache is enabled. If the plugin cache is not enabled, there is nothing to protect, and thus no need to take the lock.

This change also removes locking for all terraform plan operations, on the assumption that conflicts are unlikely, and can easily be retried on a subsequent reconcile if they do happen.

I have:

How has this code been tested

Unit tests

toastwaffle commented 4 months ago

I have now tested this locally with 4 workspaces with the plugin cache disabled doing long-running applies (GKE cluster creation) in parallel (where previously they'd have gotten stuck), and 4 other workspaces with the plugin cache enabled successfully reconciling some DNS records

toastwaffle commented 4 months ago

@bobh66 does this qualify for an off-schedule release, or does this need to wait until the 29th?

bobh66 commented 4 months ago

Good question - seems like a good candidate for a backport - I'll see what the release team thinks

github-actions[bot] commented 4 months ago

Successfully created backport PR #242 for release-0.14.