Skip to content

Commit

Permalink
Fix goroutine leak when reconciling
Browse files Browse the repository at this point in the history
This patch fixes the propagation of context cancellation through the
call stack. It prevents leaks of channel and goroutine from the
[terraform provider][provider_code].

Closes: crossplane-contrib#538

[provider_code]: https://github.com/hashicorp/terraform-provider-google/blob/1d1a50adf64af60815b7a08ffc5e9d3e856d2e9c/google/transport/batcher.go#L117-L123
  • Loading branch information
IxDay committed Jun 10, 2024
1 parent 9941c1a commit 5630f52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/clients/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func configureNoForkGCPClient(ctx context.Context, ps *terraform.Setup, p schema
// only once and using a pointer argument here will cause
// race conditions between resources referring to different
// ProviderConfigs.
diag := p.Configure(context.WithoutCancel(ctx), &tfsdk.ResourceConfig{
diag := p.Configure(ctx, &tfsdk.ResourceConfig{
Config: ps.Configuration,
})
if diag != nil && diag.HasError() {
Expand Down

0 comments on commit 5630f52

Please sign in to comment.