[GODRIVER-2452] Data Race condition in sessionImpl.clientSession.Aborting Created: 08/Jun/22  Updated: 27/Oct/23  Resolved: 14/Jun/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kush Patel Assignee: Matt Dale
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GODRIVER-2453 Mention that Session and Transaction ... Closed

 Description   

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

 


Generated at Thu Feb 08 08:38:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.