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

TestCollection/insert_many tests intermittently fail with data race panic.

    • Type: Icon: Build Failure Build Failure
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.0.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Name of Failure:

      All of the "TestCollection/insert_many" tests failed with a data race panic.

      Link to task:

      https://spruce.mongodb.com/task/mongo_go_driver_race_test__version~7.0_os_ssl_40~rhel87_64_test_race_cadfe9692282fb29baa1b4551bda5d1e40f21a2c_24_08_09_19_17_20/tests?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      The test failure occurs during the "TestCollection/insert_many tests when the race detector is enabled. The failure is intermittent and hasn't happened in the last few waterfall builds. It only happens on the "master" branch.

      Stack trace:

      [2024/08/09 12:31:55.257] ==================
      [2024/08/09 12:31:55.257] WARNING: DATA RACE
      [2024/08/09 12:31:55.257] Read at 0x00c001e18082 by goroutine 1243946:
      [2024/08/09 12:31:55.257]   runtime.slicecopy()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/runtime/slice.go:325 +0x0
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/bsonx/bsoncore.AppendArray()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go:267 +0x14a
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/bsonx/bsoncore.AppendArrayElement()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go:272 +0xb5
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver/operation.(*EndSessions).command()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation/end_sessions.go:72 +0x91
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver/operation.(*EndSessions).command-fm()
      [2024/08/09 12:31:55.257]       <autogenerated>:1 +0x9d
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver.Operation.addCommandFields()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go:1410 +0xed
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver.Operation.createMsgWireMessage()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go:1325 +0x65b
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver.Operation.createWireMessage()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go:1403 +0x3de
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver.Operation.Execute()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go:725 +0x12fc
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/x/mongo/driver/operation.(*EndSessions).Execute()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/x/mongo/driver/operation/end_sessions.go:66 +0x327
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/mongo.(*Client).endSessions()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/mongo/client.go:510 +0x879
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/mongo.(*Client).Disconnect()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/mongo/client.go:360 +0x24d
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).Run.(*T).RunOpts.func1.1()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:260 +0x171
      [2024/08/09 12:31:55.257]   runtime.deferreturn()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/runtime/panic.go:602 +0x5d
      [2024/08/09 12:31:55.257]   testing.tRunner()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1689 +0x21e
      [2024/08/09 12:31:55.257]   testing.(*T).Run.gowrap1()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x44
      [2024/08/09 12:31:55.257] Previous write at 0x00c001e18080 by goroutine 1243335:
      [2024/08/09 12:31:55.257]   runtime.slicecopy()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/runtime/slice.go:325 +0x0
      [2024/08/09 12:31:55.257]   bytes.(*Buffer).Write()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/bytes/buffer.go:181 +0x118
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/bson.(*valueWriter).Flush()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/bson/value_writer.go:488 +0x9c
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/bson.(*valueWriter).WriteDocumentEnd()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/bson/value_writer.go:467 +0x25c
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/bson.(*sliceCodec).EncodeValue()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/bson/slice_codec.go:55 +0xc61
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/bson.(*Encoder).Encode()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/bson/encoder.go:56 +0x2c8
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/bson.Marshal()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/bson/marshal.go:82 +0x41a
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration.TestCollection.func2.2()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/collection_test.go:156 +0x2e4
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).Run.(*T).RunOpts.func1()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:268 +0x3ab
      [2024/08/09 12:31:55.257]   testing.tRunner()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1689 +0x21e
      [2024/08/09 12:31:55.257]   testing.(*T).Run.gowrap1()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x44
      [2024/08/09 12:31:55.257] Goroutine 1243946 (running) created at:
      [2024/08/09 12:31:55.257]   testing.(*T).Run()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x825
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).RunOpts()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:220 +0x187
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).Run()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:212 +0x6f
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration.TestCollection.func2.4()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/collection_test.go:195 +0x533
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration.TestCollection.func2.(*T).RunOpts.8()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:268 +0x3ab
      [2024/08/09 12:31:55.257]   testing.tRunner()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1689 +0x21e
      [2024/08/09 12:31:55.257]   testing.(*T).Run.gowrap1()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x44
      [2024/08/09 12:31:55.257] Goroutine 1243335 (running) created at:
      [2024/08/09 12:31:55.257]   testing.(*T).Run()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x825
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).RunOpts()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:220 +0x187
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration/mtest.(*T).Run()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:212 +0x6f
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration.TestCollection.func2()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/collection_test.go:140 +0x9d
      [2024/08/09 12:31:55.257]   go.mongodb.org/mongo-driver/v2/internal/integration.TestCollection.(*T).RunOpts.func22()
      [2024/08/09 12:31:55.257]       /data/mci/839134de377bb0b71b7eef32010ddd50/src/go.mongodb.org/mongo-driver/internal/integration/mtest/mongotest.go:268 +0x3ab
      [2024/08/09 12:31:55.257]   testing.tRunner()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1689 +0x21e
      [2024/08/09 12:31:55.257]   testing.(*T).Run.gowrap1()
      [2024/08/09 12:31:55.257]       /opt/golang/go1.22/src/testing/testing.go:1742 +0x44
      [2024/08/09 12:31:55.257] ==================
      

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

              Created:
              Updated: