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

Leaking connections

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 1.13.0, 1.14.0, 1.15.0
    • 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?

      Connections are leaking. Most likely related to https://github.com/mongodb/mongo-go-driver/commit/99bdb9492372cbf681e337926aca708bb3319076

      File x/mongo/driver/topology/server.go
      ```
      if isStreamingEnabled(s) && isStreamable(s) && !s.rttMonitor.started

      {             s.rttMonitor.connect()         }

      ```
      Here is a call to s.rttMonitor.started without a mutex. Which can lead to calling multiple connection methods.

      Detailed steps to reproduce the problem?

      Include full traceback, if possible

      Definition of done: what must be done to consider the task complete?

      The exact Go version used, with patch level:

      $ go version 

      1.21

      The exact version of the Go driver used:

      $ go list -m go.mongodb.org/mongo-driver

      go.mongodb.org/mongo-driver v1.15.0

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      replica set, 3 hosts

      1. mongod --version
        db version v6.0.6
        Build Info: {
            "version": "6.0.6",
            "gitVersion": "26b4851a412cc8b9b4a18cdb6cd0f9f642e06aa7",
            "openSSLVersion": "OpenSSL 1.1.1f  31 Mar 2020",
            "modules": [],
            "allocator": "tcmalloc",
            "environment": {         "distmod": "ubuntu2004",         "distarch": "x86_64",         "target_arch": "x86_64"     }

        }

        The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      Ubuntu 20.04.6 LTS (Focal Fossa)

      Security Vulnerabilities

      If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here

            Assignee:
            Unassigned Unassigned
            Reporter:
            meizumy16@gmail.com Егор Бронин
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: