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

Data race in TestTimeoutPlaceholderAllocReleased

    XMLWordPrintableJSON

Details

    Description

      Found the following data race when running unit tests locally for core:

      ==================
      WARNING: DATA RACE
      Read at 0x00c0004ceda0 by goroutine 18:
        github.com/apache/yunikorn-core/pkg/scheduler/objects.(*Application).timeoutPlaceholderProcessing()
            /home/bacskop/repos/incubator-yunikorn-core/pkg/scheduler/objects/application.go:415 +0xcf8
        github.com/apache/yunikorn-core/pkg/scheduler/objects.(*Application).timeoutPlaceholderProcessing-fm()
            <autogenerated>:1 +0x39
      
      Previous write at 0x00c0004ceda0 by goroutine 17:
        github.com/apache/yunikorn-core/pkg/scheduler/objects.(*Application).addPlaceholderData()
            /home/bacskop/repos/incubator-yunikorn-core/pkg/scheduler/objects/application.go:1752 +0xb1
        github.com/apache/yunikorn-core/pkg/scheduler/objects.TestTimeoutPlaceholderAllocReleased()
            /home/bacskop/repos/incubator-yunikorn-core/pkg/scheduler/objects/application_test.go:1313 +0x384
        testing.tRunner()
            /snap/go/9991/src/testing/testing.go:1439 +0x213
        testing.(*T).Run.func1()
            /snap/go/9991/src/testing/testing.go:1486 +0x47
      
      Goroutine 18 (running) created at:
        time.goFunc()
            /snap/go/9991/src/time/sleep.go:176 +0x47
      
      Goroutine 17 (running) created at:
        testing.(*T).Run()
            /snap/go/9991/src/testing/testing.go:1486 +0x724
        testing.runTests.func1()
            /snap/go/9991/src/testing/testing.go:1839 +0x99
        testing.tRunner()
            /snap/go/9991/src/testing/testing.go:1439 +0x213
        testing.runTests()
            /snap/go/9991/src/testing/testing.go:1837 +0x7e4
        testing.(*M).Run()
            /snap/go/9991/src/testing/testing.go:1719 +0xa71
        main.main()
            _testmain.go:415 +0x3a9
      ==================
      

      We need to use a locked version of addPlaceholderData().

      Attachments

        Issue Links

          Activity

            People

              pbacsko Peter Bacsko
              pbacsko Peter Bacsko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: