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

Implement base driver.Connection type

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: None
    • Component/s: Core API
    • None
    • Minor Change

      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.

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

              Created:
              Updated:
              Resolved: