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

Use Interlocker.CompareExchange in the ServerMonitor in the same way as in Server

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Connectivity
    • None

      As part of CSHARP-3057, we added a `ServerDescription` to `Server.cs`. The `SetDescription` method was initially modeled after the one we use in `ServerMonitor` but due to concerns about race conditions, we ended using a different pattern.

      I've included a screenshot of the linked explanation due to the tendency of that PR to display a Unicorn error. Given the default heartbeat interval, this race condition isn't likely to occur IMHO, but updating the code to use the pattern we now use in `Server.SetDescription` would prevent it altogether.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            vincent.kam@mongodb.com Vincent Kam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: