Simplify server description string in timeout exceptions

XMLWordPrintableJSON

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

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: