[GODRIVER-2181] Use dedicated state constants for the connection, pool, poolGenerationMap, Server, and Topology types Created: 11/Oct/21 Updated: 03/May/22 Resolved: 16/Mar/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Matt Dale | Assignee: | Matt Dale |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | Avoiding connection storms |
| Quarter: | FY22Q4 |
| Description |
|
Currently, connection, pool, Server, and Topology all use the same set of "connected state" constants (defined in server.go). However, their state transitions are confusingly different, leading to misunderstanding about how to check connected state of those different types (and bugs). For example, all of those types use the connected and disconnected states, but not all use connecting, disconnecting, and initialized. There's also a bug in Topology.Connect() that prevents a Topology from ever connecting if the Connect() function encounters an error while connecting the topology. The Topology gets stuck in the connecting state, which causes all subsequent calls to Connect() to return ErrTopologyConnected. There's a similar bug in Server.Disconnect().
The best first step here is to use a different set of constants for each type's "state" value. New definition of done:
|
| Comments |
| Comment by Githook User [ 16/Mar/22 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: |
| Comment by Matt Dale [ 10/Mar/22 ] |