Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
Storage NYC 2019-03-25
-
61
-
2
Description
ServiceContext::ClientDeleter::operator()(Client* client) accesses the serviceContext outside the serviceContext's mutex to call the registered observers on onDestroy(), while the serviceContext may have already been destroyed by service_context_test_fixture, since the client vector is empty, checked by waitForClientsToFinish.
void ServiceContext::ClientDeleter::operator()(Client* client) const { |
ServiceContext* const service = client->getServiceContext(); |
{
|
stdx::lock_guard<stdx::mutex> lk(service->_mutex);
|
invariant(service->_clients.erase(client));
|
if (service->_clients.empty()) { |
service->_clientsEmptyCondVar.notify_all();
|
}
|
}
|
// The serviceContext may have already been destroyed. |
onDestroy(client, service->_clientObservers);
|
delete client; |
}
|
Attachments
Issue Links
- depends on
-
SERVER-39079 Add parallel IndexBuildsCoordinator checks wherever BackgroundOperation checks are done
-
- Closed
-