Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4090

Speculative auth on a pooled client may reuse a closed stream

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: