gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.09k stars 981 forks source link

fatal error: concurrent map writes #3456

Closed davidorlea closed 1 month ago

davidorlea commented 1 month ago

Describe the bug

Since upgrading from Terragrunt 0.59.6 to 0.67.13 we are repeatedly getting fatal error: concurrent map writes when calling terragrunt init, terragrunt validate, terragrunt validate-inputs or terragrunt plan. This is not happening in every call to terragrunt, but pretty regularly, effectively rendering our CI pipelines unusable.

The stack trace is always from

github.com/gruntwork-io/terragrunt/internal/cache.(*ExpiringCache[...]).Get(0x2884e40, {0x2884628, 0xc000d41030}, {0xc000062249, 0x4c})
    /home/circleci/project/internal/cache/cache.go:99 +0x205

I attached a few examples with the complete stack traces.

We experience this locally on Apple ARM-based (M1, M2) MacBooks, as well as AWS EC2 instances running on amd64-based architecture.

With Terragrunt 0.59.6 this did not happen once to us.

Steps To Reproduce

Can't be reproduced explicitly, but occurs regularly every few terragrunt-calls.

Expected behavior

No exception and clean exit from Terragrunt.

Nice to haves

Versions

Additional context

fatal1.txt fatal2.txt fatal3.txt

yhakbar commented 1 month ago

Thanks for reporting this, @davidorlea . We'll look into it soon.

yhakbar commented 1 month ago

Fix pre-released in v0.68.0-beta2024100702. Will be included in the next minor release.

davidorlea commented 1 month ago

Very much appreciate your quick response ❤️

I can confirm that it's running smoothly now!