Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-314

Gracefully handle errors parsing isMaster responses for SDAM monitoring

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-rc0
    • Component/s: None
    • Labels:

      Description

      Currently, our code for constructing a ServerDescription for publishing in an SDAM monitoring event assumes the description is well-formed - for ex. that the host-port String is formatted as host:port. 

      We do some force unwrapping, and a lot of casting/field lookups that may silently fail. 

      We might consider refactoring to better handle errors, and decide how we should handle publishing SDAM events where we run into such errors: do we skip them? do we publish them with a missing field? etc. 

      I think the server description parsing could probably also be rewritten to better take advantage of BSONDecoder.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              patrick.freed Patrick Freed
              Reporter:
              kaitlin.mahar Kaitlin Mahar
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: