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

Data race in resources.go

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 0.9
    • None
    • core - scheduler
    • None

    Description

      I added multiple pods in my docker-desktop environment and got the following data race:

      ==================
      WARNING: DATA RACE
      Write at 0x00c00a8fa030 by goroutine 75:
        runtime.mapassign_faststr()
            /usr/local/go/src/runtime/map_faststr.go:202 +0x0
        github.com/apache/incubator-yunikorn-core/pkg/common/resources.(*Resource).AddTo()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/common/resources/resources.go:136 +0x1c7
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*SchedulingApplication).addAllocationAsk()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduling_application.go:243 +0x3ed
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).updateSchedulingRequest()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:163 +0x10b
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).processAllocationUpdateEvent()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:415 +0x276
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).handleSchedulerEvent()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:597 +0x38b
      
      Previous read at 0x00c00a8fa030 by goroutine 77:
        runtime.mapiterinit()
            /usr/local/go/src/runtime/map.go:797 +0x0
        github.com/apache/incubator-yunikorn-core/pkg/common/resources.StrictlyGreaterThanZero()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/common/resources/resources.go:690 +0xb1
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.filterOnPendingResources()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/sorters.go:85 +0x168
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.sortApplications()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/sorters.go:61 +0x2a4
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*SchedulingQueue).sortApplications()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduling_queue.go:446 +0xe8
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*SchedulingQueue).tryAllocate()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduling_queue.go:556 +0xb6
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*SchedulingQueue).tryAllocate()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduling_queue.go:569 +0x6da
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*partitionSchedulingContext).tryAllocate()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduling_partition.go:371 +0x93
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).schedule()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:649 +0x9d2
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).internalSchedule()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:103 +0x38
      
      Goroutine 75 (running) created at:
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).StartService()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:67 +0x9d
        github.com/apache/incubator-yunikorn-core/pkg/entrypoint.startAllServicesWithParameters()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/entrypoint/entrypoint.go:87 +0x64c
        github.com/apache/incubator-yunikorn-core/pkg/entrypoint.StartAllServices()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/entrypoint/entrypoint.go:43 +0x77
        main.main()
            /Users/adamantal/git/yunikorn/yunikorn-k8shim/pkg/shim/main.go:45 +0x4e9
      
      Goroutine 77 (running) created at:
        github.com/apache/incubator-yunikorn-core/pkg/scheduler.(*Scheduler).StartService()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/scheduler/scheduler.go:74 +0x1b9
        github.com/apache/incubator-yunikorn-core/pkg/entrypoint.startAllServicesWithParameters()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/entrypoint/entrypoint.go:87 +0x64c
        github.com/apache/incubator-yunikorn-core/pkg/entrypoint.StartAllServices()
            /Users/adamantal/git/yunikorn/yunikorn-core/pkg/entrypoint/entrypoint.go:43 +0x77
        main.main()
            /Users/adamantal/git/yunikorn/yunikorn-k8shim/pkg/shim/main.go:45 +0x4e9
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            adam.antal Adam Antal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: