[SERVER-5110] ReplicaSetMonitor::check not thread safe wrt _master Created: 27/Feb/12 Updated: 11/Jul/16 Resolved: 03/Apr/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.5, 2.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Greg Studer | Assignee: | Randolph Tan |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
It's possible for a thread to notifyFailure(), resetting the _master variable to -1, between the time when the _master variable is checked here and when it is actually used to access the nodes array. We need to acquire _lock to do this safely. There may be other issues here - the _check code modifies _master without locks in other places? |
| Comments |
| Comment by auto [ 17/Apr/12 ] |
|
Author: {u'login': u'renctan', u'email': u'renctan@gmail.com', u'name': u'renctan'}Message: undo |
| Comment by auto [ 17/Apr/12 ] |
|
Author: {u'login': u'', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}Message: Made chages to make sure that proper mutexes are held when modifying _master and _nodes. |
| Comment by auto [ 04/Apr/12 ] |
|
Author: {u'login': u'renctan', u'name': u'renctan', u'email': u'renctan@gmail.com'}Message: undo |
| Comment by auto [ 03/Apr/12 ] |
|
Author: {u'login': u'', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}Message: Made chages to make sure that proper mutexes are held when modifying _master and _nodes. |