[CSHARP-2403] Log any unexpected exceptions that occur in SDAM code Created: 02/Oct/18  Updated: 28/Oct/23  Resolved: 09/Oct/18

Status: Closed
Project: C# Driver
Component/s: Connectivity, Diagnostics
Affects Version/s: None
Fix Version/s: 2.7.1

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

Issue Links:
Depends

 Description   

There are at least two places in the SDAM code where exceptions are ignored. See:

https://github.com/mongodb/mongo-csharp-driver/blob/v2.7.0/src/MongoDB.Driver.Core/Core/Servers/ServerMonitor.cs#L127

https://github.com/mongodb/mongo-csharp-driver/blob/v2.7.0/src/MongoDB.Driver.Core/Core/Clusters/MultiServerCluster.cs#L229

To be fair, we don't actually expect exceptions in either of these places, which is why ignoring them hasn't generally been a problem.

However, any exceptions that might occur here due to bugs in the driver should not be ignored, so we should capture them and log them in some way.



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

Author:

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

Message: CSHARP-2403: Log any unexpected exceptions that occur in SDAM.
Branch: v2.7.x
https://github.com/mongodb/mongo-csharp-driver/commit/9a0b56a681428919f51b737b8906c49bb4ef0cff

Comment by Githook User [ 09/Oct/18 ]

Author:

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

Message: CSHARP-2403: Log any unexpected exceptions that occur in SDAM.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a9a79dca78663f71e5d5044b6cbf4474fccf4690

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