[CDRIVER-3654] Pooled handshake does not handle network errors correctly Created: 06/May/20 Updated: 23/Mar/23 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | libmongoc, network |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If a network error occurs before the ismaster handshake completes, SDAM says this should invalidate the server description if the connection's generation is valid:
The current behavior is a bit buggy. _mongoc_stream_run_ismaster uses the current server description and runs a the ismaster with mongoc_cluster_run_command_private. That function handles network errors as if they are post-handshake errors (invalidates a server if non-timeout). When that error bubbles up to _mongoc_cluster_stream_for_server, it ends up invalidating the server again. I believe this has been a long-standing issue, and in practice this may not be terribly problematic to have multiple invalidations. Here's one such scenario where this could happen.
The introduction of a connection generation of |