[CDRIVER-4090] Speculative auth on a pooled client may reuse a closed stream Created: 16/Jul/21  Updated: 31/Mar/22

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

Type: Bug Priority: Unknown
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3934 _mongoc_cluster_auth_node(): precondi... Closed

 Description   

Background & Motivation

The changes of CDRIVER-3934 ensured that a failure to complete speculative authentication due to a network error would not attempt to restart the authentication handshake.

A pooled client has similar behavior in _mongoc_cluster_add_node:

      bool is_auth = _mongoc_cluster_finish_speculative_auth (
         cluster, stream, sd, &speculative_auth_response, &scram, error);
 
      if (!is_auth && !_mongoc_cluster_auth_node (cluster,
                                                  cluster_node->stream,
                                                  sd,
                                                  &sasl_supported_mechs,
                                                  error)) {

If a network error occurs during _mongoc_cluster_finish_speculative_auth, the newly closed stream is reused for the re-authentication attempt.

Scope
TBD. This may be low impact if the only consequence is an immediate network error on the first attempt to reuse the closed stream. Investigate the impact and possible solutions.


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