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
fake client: fatal error: concurrent map read and map write #2634
Comments
@lanyao-travel fake client has evolved quite a bit over time, are you seeing the same issue with the latest release? (v0.16.3) |
/kind support |
We had a similar issue with a data race in our code. We found the root cause using the golang data race detector. Our issue was caused by a reconciler watch predicate that was modifying cached objects. Context: #2391 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Problem Description
I encountered a fatal error indicating a concurrent map read and map write while using the fake client package. Here is the stack trace of the error:
fatal error: concurrent map read and map write
goroutine 85 [running]:
k8s.io/apimachinery/pkg/runtime.(*Scheme).ObjectKinds(0xc000254230, {0x1876b10?, 0xc000680c00})
/home/goproject/pkg/mod/k8s.io/apimachinery@v0.24.2/pkg/runtime/scheme.go:267 +0xf0
sigs.k8s.io/controller-runtime/pkg/client/apiutil.GVKForObject({0x1876b10?, 0xc000680c00}, 0x0?)
/home/goproject/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.0/pkg/client/apiutil/apimachinery.go:98 +0x21c
sigs.k8s.io/controller-runtime/pkg/client/fake.getGVRFromObject({0x1876b10?, 0xc000680c00?}, 0x2?)
/home/goproject/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.0/pkg/client/fake/client.go:659 +0x53
sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeClient).Get(0xc00049bb40, {0x7f4fca4bbb28?, 0x30?}, {{0xc00023a2b8?, 0xc000580000?}, {0xc00071e2e8?, 0xc0005d3640?}}, {0x1899430?, 0xc000680c00})
/home/goproject/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.0/pkg/client/fake/client.go:333 +0xa5
The text was updated successfully, but these errors were encountered: