Operational Defect Database

BugZero found this defect 40 days ago.

MongoDB | 2636716

Data race on ReplicaSetMonitorManager::_stats

Last update date:

4/9/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

The ReplicaSetMonitorManager::_stats member can be concurrently accessed from different threads without synchronization, i.e. via report() where it is read without synchronization. This member has type shared_ptr - note that while the pointed-to object is thread-safe/synchronized, the shared_ptr object itself still requires synchronization, and cannot be accessed concurrently by different threads (one of which writes/mutates it) without additional synchronization. We should fix it by either gating access with the ReplicaSetMonitorManager::_mutex or using the new c++20 atomic

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

In Progress

Learn More

Search:

...