The pooled version of the test for CDRIVER-1139 can fail at the end of these lines:
/* insert a 'fake' server description and ensure that it is invalidated by * driver */ host_list_init (&fake_host_list, AF_INET, "fakeaddress", 27033); mongoc_server_description_init ( fake_sd, fake_host_list.host_and_port, fake_id); fake_sd->type = MONGOC_SERVER_STANDALONE; mongoc_set_add (td->servers, fake_id, fake_sd); mongoc_topology_scanner_add ( client->topology->scanner, &fake_host_list, fake_id); BSON_ASSERT (!mongoc_cluster_stream_for_server ( &client->cluster, fake_id, true, &error)); sd = (mongoc_server_description_t *) mongoc_set_get (td->servers, fake_id); BSON_ASSERT (sd);
There's a race between the test and the background scanner. If the scanner is triggered between mongoc_cluster_stream_for_server and mongoc_set_get, the server description is removed and mongoc_set_get returns NULL. If the description is destroyed then I suppose there could be a crash, but I've only observed the NULL return:
- is related to
-
CDRIVER-1139 Network err must invalidate server description
- Closed
- related to
-
CDRIVER-2394 /Topology/invalidate_server/ tests are slow with SSL
- Closed