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

Implement base driver.Connection type



    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.1.0
    • 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.


        Issue Links



              kris.brandow@mongodb.com Kristofer Brandow (Inactive)
              kris.brandow@mongodb.com Kristofer Brandow (Inactive)
              0 Vote for this issue
              1 Start watching this issue