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

Panic when reading data from connection

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0, 1.17.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Not Needed
    • 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?

      Do not have exact steps to replicate the problem, but when running a performance test, I observed a bunch of i/o timeouts followed by panic

      [fetch] error fetching record: connection(<mongo-ip>:27017[-398]) incomplete read of full message: context deadline exceeded: read tcp <application-ip>:59026-><mongo-ip>:27017: i/o timeout
      [fetch] error fetching record: connection(<mongo-ip>:27017[-390]) incomplete read of full message: context deadline exceeded: read tcp <application-ip>:59018-><mongo-ip>:27017: i/o timeout
      [fetch] error fetching record: connection(<mongo-ip>:27017[-386]) incomplete read of full message: context deadline exceeded: read tcp <application-ip>:58999-><mongo-ip>:27017: i/o timeout
      [fetch] error fetching record: connection(<mongo-ip>:27017[-370]) incomplete read of full message: context deadline exceeded: read tcp <application-ip>:58982-><mongo-ip>:27017: i/o timeout
      panic: runtime error: slice bounds out of range [4:0]
      
      
      goroutine 346147 [running]:
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*connection).read(0x14324e10588, {0x101c03710, 0x10272d100})
      /Users/user/.gvm/pkgsets/go1.22.4/global/pkg/mod/go.mongodb.org/mongo-driver@v1.16.0/x/mongo/driver/topology/connection.go:488+0x46c
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.bgRead(0x14003382300, 0x14324e10588)
      /Users/user/.gvm/pkgsets/go1.22.4/global/pkg/mod/go.mongodb.org/mongo-driver@v1.16.0/x/mongo/driver/topology/pool.go:827+0x2a8
      created by go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).checkInNoEvent in goroutine 344634
      /Users/user/.gvm/pkgsets/go1.22.4/global/pkg/mod/go.mongodb.org/mongo-driver@v1.16.0/x/mongo/driver/topology/pool.go:891+0x23c 

      Go Version: 1.22.4{}

      Go Driver Version: v1.16.0

      MongoDB Server

      3 node cluster

      Server version: v6.0.16

      Hosted on GCP

      OS Version: Ubuntu 20.04.2 LTS

            Assignee:
            qingyang.hu@mongodb.com Qingyang Hu
            Reporter:
            mohan@rapido.bike Mohan Kumar B
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: