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

Crash in mongoc_topology_description_invalidate_server

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.2.0
    • Component/s: libmongoc
    • Labels:
      None

      Seen once in the ""/Topology/invalidate_server/pooled" test: if an application thread fails to open a new socket in _mongoc_cluster_stream_for_server_description, it calls mongoc_topology_invalidate_server, which locks the topology and calls mongoc_topology_description_invalidate_server.

      However, the topology scanner thread might have detected the down server and removed its server description before the application thread got the topology lock. In that case we get a NULL server description and pass it to mongoc_topology_description_invalidate_server:

      void
      mongoc_topology_description_invalidate_server (mongoc_topology_description_t *topology,
                                                     uint32_t                       id,
                                                     const bson_error_t            *error)
      {
         mongoc_server_description_t *sd;
      
         sd = mongoc_topology_description_server_by_id (topology, id, NULL);
         mongoc_topology_description_handle_ismaster (topology, sd, NULL, 0, NULL);
      }
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: