[CSHARP-3128] Use Interlocker.CompareExchange in the ServerMonitor in the same way as in Server Created: 08/Jun/20  Updated: 31/Mar/22

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

Type: Improvement Priority: Minor - P4
Reporter: Vincent Kam (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-06-08-17-37-50-057.png    
Issue Links:
Related
related to CSHARP-3057 Reduce race conditions in SDAM error ... Closed

 Description   

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.

 


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