-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
function deleteSWGAutoGenRouter doesn't wait for the operation to finish #18140
function deleteSWGAutoGenRouter doesn't wait for the operation to finish #18140
Comments
Hi @teyuchang! I used exactly your same code, terraform version(0.13.7) and Google provider version(4.84.0) and followed your steps to reproduce this issue:
But I didn't get any error or the behavior you commented. Are there other configurations or resources involved, or do I need to wait more than a minute after creation to run `terraform destroy? |
Thank you for testing. Unfortunately, this bug is flaky and may not happen every time. The key factor in reproducing it is the time it takes to delete the router – a longer deletion time makes it more likely to happen. To consistently reproduce it, you can use a test stub instead of actual GCP endpoints and intentionally delay the router deletion process. Here's a simplified version of how the Terraform example works: Creation(
Deletion(
The problem occurs during step 1 of the deletion process. Terraform attempts to delete the router but doesn't wait for the long-running operation to finish. This means the router might still exist when Terraform tries to delete the VPC in step 3, causing the VPC deletion to fail. The relevant code is in deleteSWGAutoGenRouter. The response is ignored using |
Confirmed issue, as the user reports the more time we wait to delete the resources triggers this behavior. After waiting more than 12 hrs and running a
|
any update regarding this bug? |
Community Note
Terraform Version & Provider Version(s)
Terraform v0.13.7
on linux/amd64
Affected Resource(s)
google_network_services_gateway
Terraform Configuration
Debug Output
No response
Expected Behavior
The function deleteSWGAutoGenRouter should wait until the operation finishes.
Actual Behavior
deleteSWGAutoGenRouter returns immediately after it sends a Delete request without waiting the operation to finish. It sometimes results in
terraform destroy
failureSteps to reproduce
terraform apply
terraform destroy
Important Factoids
No response
References
No response
b/342170266
The text was updated successfully, but these errors were encountered: