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

Implement base driver.Connection type

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: Core API
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      Description

      Create a new type, topology.connection that implements a subset of the driver.Connection type. This type is a combination of connection.pooledConnection and connection.connection. The topology.pool type should deal directly with this type. There is no Close method on topology.connection, instead the pool.returnConnection or pool.closeConnection method should be used.

       

      This type is also responsible for handling wire message compression, as the connection.connection type did. Since wire message compression requires knowledge of the command being run, this logic should be handled inside of the driver package. This can likely be consolidated into the driver.OperationContext type which can check for compression right after the command is appended onto the wire message.

       

      SDAM error handling should also be handled by this type. This is different from the previous implementation since error extraction occurs in the driver package. We should directly inspect the wire message bytes to determine if there was a command error (including write concern errors) and update the server description and drain the
      pool as required. The original design had SDAM error processing handled by the connection implementation, but this forces double decoding of wire messages, which can be expensive. Instead, we make a new interface in the driver package called ErrorProcessor. If a Server implements ErrorProcessor then it's ProcessError method will be called with the error that comes from decoding the wire message.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kris.brandow Kristofer Brandow (Inactive)
              Reporter:
              kris.brandow Kristofer Brandow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: