Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-2392

Concurrent map write in SchedulerCache

    XMLWordPrintableJSON

Details

    Description

      While running the simple performance test with MockScheduler, the following error was detected:

      fatal error: concurrent map writes
      
      goroutine 16 [running]:
      github.com/apache/yunikorn-k8shim/pkg/cache/external.(*SchedulerCache).removeSchedulingTask(0xc0004261e0, {0xc00d6be600?, 0xc00d6be600?})
      	/home/bacskop/repos/yunikorn-k8shim/pkg/cache/external/scheduler_cache.go:593 +0x45
      github.com/apache/yunikorn-k8shim/pkg/cache/external.(*SchedulerCache).updatePod(0xc0004261e0, 0xc034a96900)
      	/home/bacskop/repos/yunikorn-k8shim/pkg/cache/external/scheduler_cache.go:511 +0x8d1
      github.com/apache/yunikorn-k8shim/pkg/cache/external.(*SchedulerCache).UpdatePod(0xc0004261e0, 0x1a?)
      	/home/bacskop/repos/yunikorn-k8shim/pkg/cache/external/scheduler_cache.go:468 +0xba
      github.com/apache/yunikorn-k8shim/pkg/cache.(*Context).updateYuniKornPod(0xc00012a090, 0xc034a96900)
      	/home/bacskop/repos/yunikorn-k8shim/pkg/cache/context.go:306 +0x285
      github.com/apache/yunikorn-k8shim/pkg/cache.(*Context).UpdatePod(0xc00012a090, {0xc0001da060?, 0xc0001da120?}, {0x1f92940?, 0xc034a96900?})
      	/home/bacskop/repos/yunikorn-k8shim/pkg/cache/context.go:288 +0x2b9
      k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnUpdate(...)
      	/home/bacskop/go/pkg/mod/k8s.io/client-go@v0.29.1/tools/cache/controller.go:246
      github.com/apache/yunikorn-k8shim/pkg/client.(*MockedAPIProvider).RunEventHandler.func1()
      	/home/bacskop/repos/yunikorn-k8shim/pkg/client/apifactory_mock.go:284 +0x5da
      created by github.com/apache/yunikorn-k8shim/pkg/client.(*MockedAPIProvider).RunEventHandler in goroutine 13
      	/home/bacskop/repos/yunikorn-k8shim/pkg/client/apifactory_mock.go:240 +0xda
      

      We need locking inside SchedulerCache.addSchedulingTask().

      Attachments

        Issue Links

          Activity

            People

              ccondit Craig Condit
              pbacsko Peter Bacsko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: