Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2452

Data Race condition in sessionImpl.clientSession.Aborting

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      The Realm team has noticed some data race errors in QA with the mongo-go-driver. We haven't been able to reproduce the issue but it seems to be occurring during an update.

      Version: v1.9.0-baas.1 (the driver code should not deviate much from the main 1.9.0 driver in regards to the code in the below stack trace)

       

      Link to location of data race

      Stack trace:

      WARNING: DATA RACE
      Write at 0x00c02ce5aa04 by goroutine 941:
        go.mongodb.org/mongo-driver/mongo.(*sessionImpl).AbortTransaction()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/mongo/session.go:276 +0x268
        github.com/10gen/baas/service/services/mongodb.(*clientSession).abortTransaction()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/service/services/mongodb/client_session.go:131 +0xfe
        github.com/10gen/baas/service/services/mongodb.(*clientSession).abortTransaction-fm()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/service/services/mongodb/client_session.go:128 +0x6d
        github.com/10gen/baas/function/execution/vm.createAsyncWork.func1()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/function/execution/vm/context.go:851 +0x307
        github.com/10gen/baas/function/execution/vm.(*eventLoop).processAsyncWorkQueue.func1.1.1()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/function/execution/vm/event_loop.go:490 +0xd8
        github.com/10gen/baas/function/execution/vm.(*eventLoop).processAsyncWorkQueue.func1.1()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/function/execution/vm/event_loop.go:492 +0xc4
        github.com/10gen/baas/function/execution/vm.(*eventLoop).processAsyncWorkQueue.func1()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/function/execution/vm/event_loop.go:529 +0x249
        github.com/10gen/baas/utils.PanicCapturingFuncWithCallback()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/utils/utils.go:216 +0x77
        github.com/10gen/baas/utils.PanicCapturingFunc()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/utils/utils.go:188 +0x30
        github.com/10gen/baas/utils.PanicCapturingGo·dwrap·38()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/utils/utils.go:222 +0x39
      Previous read at 0x00c02ce5aa04 by goroutine 1110:
        go.mongodb.org/mongo-driver/x/mongo/driver.Operation.retryable()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/x/mongo/driver/operation.go:711 +0x8e
        go.mongodb.org/mongo-driver/x/mongo/driver.Operation.Execute()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/x/mongo/driver/operation.go:394 +0x65a
        go.mongodb.org/mongo-driver/x/mongo/driver/operation.(*Update).Execute()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/x/mongo/driver/operation/update.go:160 +0x52e
        go.mongodb.org/mongo-driver/mongo.(*Collection).updateOrReplace()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/mongo/collection.go:576 +0x1405
        go.mongodb.org/mongo-driver/mongo.(*Collection).UpdateOne()
            /root/go/pkg/mod/github.com/mongodb-forks/mongo-go-driver@v1.9.0-baas.1/mongo/collection.go:644 +0x197
        github.com/10gen/baas/service/services/mongodb.(*mongoCollection).UpdateOne.func1()
            /data/mci/aa012eacb13ba2b04d14186538014218/baas/service/services/mongodb/collection.go:104 +0xf5 

      Note this issue is coming from charts apps created for e2e testing. Charts team hasn't noticed any unexpected errors on their end so the failed request might be expected. However, the data race seems unexpected.

      I will try to follow up with more info if I can reproduce the issue

       

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            kush.patel@mongodb.com Kush Patel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: