Skip to content
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

Open
lanyao-travel opened this issue Jan 4, 2024 · 5 comments
Open

fake client: fatal error: concurrent map read and map write #2634

lanyao-travel opened this issue Jan 4, 2024 · 5 comments
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@lanyao-travel
Copy link

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

@sbueringer
Copy link
Member

@lanyao-travel fake client has evolved quite a bit over time, are you seeing the same issue with the latest release? (v0.16.3)

@troy0820
Copy link
Member

troy0820 commented Jan 4, 2024

/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Jan 4, 2024
@nathanperkins
Copy link

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

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 7, 2024
@k8s-triage-robot
Copy link

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants