Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-20692

data race in BaseRequest.FmtPhaseCounts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.0, 5.0.0
    • 5.0.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      To reproduce, go to test/multistore/test_cases/case_functions/testcs_case_func and run "go test -race ."

      You should see several data race, including this one:

      WARNING: DATA RACE 5
      Read by goroutine 99:
        github.com/couchbase/query/server.(*BaseRequest).FmtPhaseCounts()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/server/request.go:440 +0xc4
        github.com/couchbase/query/server.(*BaseRequest).LogRequest()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/server/request.go:548 +0xed
        github.com/couchbase/query/test/multistore.(*MockServer).doStats()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/test/multistore/json.go:181 +0x7f
        github.com/couchbase/query/test/multistore.Run()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/test/multistore/json.go:216 +0x6db
        github.com/couchbase/query/test/multistore.FtestCaseFile()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/test/multistore/json.go:312 +0xa2c
        github.com/couchbase/query/test/multistore/test_cases/case_functions/testcs_case_func.testCaseFile()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/test/multistore/test_cases/case_functions/testcs_case_func/cs.go:21 +0x8d
        github.com/couchbase/query/test/multistore/test_cases/case_functions/testcs_case_func.TestAllCaseFiles()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/test/multistore/test_cases/case_functions/testcs_case_func/cs_test.go:51 +0x3b3
        testing.tRunner()
            /usr/local/Cellar/go/1.6.2/libexec/src/testing/testing.go:473 +0xdc
       
      Previous write by goroutine 163:
        sync/atomic.AddInt64()
            /usr/local/Cellar/go/1.6.2/libexec/src/runtime/race_amd64.s:262 +0xb
        github.com/couchbase/go-couchbase/platform.AddUint64()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/go-couchbase/platform/sync.go:85 +0x38
        github.com/couchbase/query/server.(*BaseRequest).AddPhaseOperator()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/server/request.go:434 +0x94
        github.com/couchbase/query/test/multistore.(*MockQuery).AddPhaseOperator()
            <autogenerated>:3 +0x55
        github.com/couchbase/query/execution.(*Context).AddPhaseOperator()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/execution/context.go:192 +0x6d
        github.com/couchbase/query/execution.(*Fetch).RunOnce()
            /Users/johanlarson/go-workspace/src/github.com/couchbase/query/execution/fetch.go:48 +0x3b
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              johan.larson Johan Larson (Inactive)
              johan.larson Johan Larson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty