[SERVER-5392] Consider allowing only one thread to be responsible in modifying _nodes in ReplicaSetMonitor Created: 24/Mar/12 Updated: 19/Mar/13 Resolved: 25/Mar/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Randolph Tan | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
For the current code right now, any thread who calls getMaster (and also the ReplicaSetMonitorWatcher) can potentially change the _nodes vector. It is easy for multiple threads to do duplicate work since it is relatively easy for a thread to be replaced by another because it will be blocked when it calls isMaster. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 25/Mar/12 ] |
|
making this code thread safe shouldn't be hard. |