[CSHARP-2884] Async Socket methods do not use Socket.ReceiveTimeout Created: 18/Dec/19  Updated: 28/Oct/23  Resolved: 10/Jan/20

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.10.0
Fix Version/s: 2.10.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:
Related
Case:

 Description   

We have recently discovered in the .NET documentation that the async Socket methods do not use the Socket.SendTimeout and Socket.ReceiveTimeout values.

Since our SDAM monitoring code uses async Socket operations (indirectly via async NetworkStream operations) the result is that any configuration of HeartbeatTimeout is not effective.

The consequence is that SDAM can take longer than expected to re-discover a server that has been temporarily black-holed.



 Comments   
Comment by Githook User [ 13/Jan/20 ]

Author:

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

Message: CSHARP-2884: Slight refactoring to match ConnectAsync.
Branch: v2.10.x
https://github.com/mongodb/mongo-csharp-driver/commit/1711193a8a3ce4ba122245f53ae2f3c75d59be94

Comment by Githook User [ 13/Jan/20 ]

Author:

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

Message: CSHARP-2884: Slight refactoring to match ConnectAsync.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/2ad99632b9af100060ce14288950114718b99e0c

Comment by Githook User [ 10/Jan/20 ]

Author:

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

Message: CSHARP-2884: Async Socket methods do not use Socket.ReceiveTimeout.
Branch: v2.10.x
https://github.com/mongodb/mongo-csharp-driver/commit/dfe9435fcb35e454e87500cff43c6696ea046884

Comment by Githook User [ 10/Jan/20 ]

Author:

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

Message: CSHARP-2884: Async Socket methods do not use Socket.ReceiveTimeout.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/85a08069e6499aa0dc87ab8f1a7616c082c19c44

Comment by Robert Stam [ 18/Dec/19 ]

Link to the .NET documentation stating that ReceiveTimeout only applies to sync calls:

https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.receivetimeout?view=netframework-4.8

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