Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2919

Simplify server description string in timeout exceptions

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Error Handling
    • Labels:
      None

      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]" }, ...
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: