[CDRIVER-3529] Do not mark server as Unknown during topology scan until after retry has failed Created: 09/Feb/20  Updated: 27/Oct/23  Resolved: 16/Jun/20

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-3563 Cursor may use an invalidated server ... Closed

 Description   

SDAM says:

Once a server is connected, the client MUST change its type to Unknown only after it has retried the server once.

libmongoc does will retry, but it marks the server description as Unknown immediately upon network error here. It should wait until after the retry, otherwise other threads will observe the unknown server description before the retry completes and could fail to select that server.



 Comments   
Comment by Kevin Albertson [ 16/Jun/20 ]

The specified behavior has changed. The new server monitoring spec now says:

When a server check fails due to a network error (including a network timeout) or a command error (ok: 0), the client MUST follow these steps:
 
1. Close the current monitoring connection.
2. Mark the server Unknown.
...

We are supposed to mark Unknown immediately now.

Comment by Kevin Albertson [ 07/May/20 ]

CDRIVER-3625 will fix this for multi-threaded.

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