[CSHARP-1481] Cluster DescriptionChanged events raised unpredictably during Initialize Created: 18/Nov/15  Updated: 20/Jan/16  Resolved: 18/Nov/15

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.0.1
Fix Version/s: 2.2

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The Initialize methods in SinglerServerCluster and MultiServerCluster call UpdateClusterDescription at the end of the method to raise a Cluster DescriptionChanged event with a Description containing the newly added servers.

However, the methods also call Initialize on each server earlier in the method, which starts up the heartbeat loops. Since the heartbeat loops run in parallel to the Initialize method, any DescriptionChanged events raised as a result of heartbeats could occur before, after or even in parallel with the DescriptionChanged event raised by the Initialize method.

The DescriptionChanged events should occur in a predictable order, and should never be raised in parallel.



 Comments   
Comment by Githook User [ 18/Nov/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1481: Raise Cluster DescriptionChanged events in a predictable order and one at a time during Initialize.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/62ad0e24a5dab86ac2dedddf0ae65430c67936cf

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