[CSHARP-2919] Simplify server description string in timeout exceptions Created: 30/Jan/20  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Error Handling
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-3775 Make root cause of errors more visibl... Backlog

 Description   

Currently the timeout exception message looks like this:

A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "2", ConnectionMode : "Automatic", Type : "ReplicaSet", State : "Connected", Servers : [{ ServerId: "{ ClusterId : 2, EndPoint : "Unspecified/mongodb01:27017" }", EndPoint: "Unspecified/mongodb01:27017", State: "Connected", Type: "ReplicaSetSecondary", WireVersionRange: "[0, 5]" }, ...

It's hard to read for two reasons:

  1. The ServerId field is redundant to the Endpoint field. The clusterId is going to be the same for all the servers anyway and it's really relevant.
  2. The Unspecified/ is confusing. It refers to the fact that it's not specified whether to connect with IPV4 or IPV6, but since almost no one actually specifies that this invariably just says Unspecified. So we could just leave it out unless it's specified.

Together that would simplify the error message in the normal case to:

A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "2", ConnectionMode : "Automatic", Type : "ReplicaSet", State : "Connected", Servers : [{ EndPoint: "mongodb01:27017", State: "Connected", Type: "ReplicaSetSecondary", WireVersionRange: "[0, 5]" }, ...


Generated at Wed Feb 07 21:43:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.