kustomize: kyaml: fatal error: concurrent map read and map write
I’m using kustomize/api to provide a Terraform provider for Kustomize. Presumably as a result of Terraform/GRPC concurrency there is a fatal error caused by concurrent map read and map write from within the kyaml code base around determining if a resource is namespace scoped.
The downstream issue has full Terraform debug output logs. But the relevant parts seem to be:
fatal error: concurrent map read and map write
goroutine 58 [running]:
runtime.throw(0x2cd0a08, 0x21)
runtime/panic.go:1116 +0x72 fp=0xc0124988f0 sp=0xc0124988c0 pc=0x1035312
runtime.mapaccess2(0x29d7b00, 0xc0082ab770, 0xc0124989a0, 0x2, 0xc01139ea10)
runtime/map.go:469 +0x25b fp=0xc012498930 sp=0xc0124988f0 pc=0x100f5bb
sigs.k8s.io/kustomize/kyaml/openapi.IsNamespaceScoped(...)
sigs.k8s.io/kustomize/kyaml@v0.10.7/openapi/openapi.go:270
sigs.k8s.io/kustomize/api/resid.Gvk.IsNamespaceableKind(0x0, 0x0, 0xc01139e9f8, 0x2, 0xc01139ea10, 0xe, 0x3e6da60)
sigs.k8s.io/kustomize/api@v0.6.9/resid/gvk.go:219 +0xf9 fp=0xc0124989d0 sp=0xc012498930 pc=0x1b37339
sigs.k8s.io/kustomize/api/resid.ResId.EffectiveNamespace(0x0, 0x0, 0xc01139e9f8, 0x2, 0xc01139ea10, 0xe, 0xc0113a6a40, 0x1c, 0xc0113a6a60, 0x11, ...)
sigs.k8s.io/kustomize/api@v0.6.9/resid/resid.go:120 +0x5a fp=0xc012498a68 sp=0xc0124989d0 pc=0x1b37eda
Kustomize version
Relevant lines from go.mod:
sigs.k8s.io/kustomize/api v0.6.9
sigs.k8s.io/kustomize/kyaml v0.10.7
I’m blocked from updating to a higher api version due to https://github.com/kubernetes-sigs/kustomize/issues/3614
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 15 (6 by maintainers)
Commits related to this issue
- Add Mutex to serialize Kustomizer runs - workaround #91 This mutex prevents multiple Kustomizer runs in parallel to avoid the `concurrent map read and map write` bug from upstream. https://github.co... — committed to kbst/terraform-provider-kustomization by pst 3 years ago
- Workaround for kustomize build panic Serialize kustomize build runs to avoid kyaml OpenAPI concurrent map read/write panic https://github.com/kubernetes-sigs/kustomize/issues/3659 Signed-off-by: Stef... — committed to fluxcd/kustomize-controller by stefanprodan 3 years ago
- Workaround for kustomize build panic Serialize kustomize build runs to avoid kyaml OpenAPI concurrent map read/write panic https://github.com/kubernetes-sigs/kustomize/issues/3659 Signed-off-by: Stef... — committed to fluxcd/kustomize-controller by stefanprodan 3 years ago
- Workaround for kustomize build panic Serialize kustomize build runs to avoid kyaml OpenAPI concurrent map read/write panic https://github.com/kubernetes-sigs/kustomize/issues/3659 Signed-off-by: Stef... — committed to fluxcd/kustomize-controller by stefanprodan 3 years ago
- Workaround for kustomize build panic Serialize kustomize build runs to avoid kyaml OpenAPI concurrent map read/write panic https://github.com/kubernetes-sigs/kustomize/issues/3659 Signed-off-by: Stef... — committed to fluxcd/kustomize-controller by stefanprodan 3 years ago
@natasha41575 Looks like relate to OpenAPI in kyaml.