[GODRIVER-930] Implement base driver.Connection type Created: 04/Apr/19  Updated: 28/Oct/23  Resolved: 26/Apr/19

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.1.0

Type: New Feature Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
has to be done before GODRIVER-929 Create topology.pool type Closed
has to be done before GODRIVER-931 Implement topology.legacyConnection type Closed
has to be done before GODRIVER-932 Update topology.Server type Closed
has to be done before GODRIVER-960 Implement SDAM error handling in topo... Closed
Epic Link: Core API
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.



 Comments   
Comment by Githook User [ 26/Apr/19 ]

Author:

{'name': 'Kris Brandow', 'username': 'skriptble', 'email': 'kris@mongodb.com'}

Message: Implement base driver.Connection type

Implements the topology.connection and topology.Connection types.

GODRIVER-930

Change-Id: If3c133b754028b8e832aa198b285593f6f2efbfc
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/3e5f96beb2f539729f3f0c8dfb7c0e31170cf241

Comment by Kristofer Brandow (Inactive) [ 12/Apr/19 ]

Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/450979.

Generated at Thu Feb 08 08:35:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.