[SERVER-28737] Have ephemeralForTest use std::mutex for protecting its internal data structures Created: 11/Apr/17 Updated: 06/Dec/17 Resolved: 25/Apr/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.7, 3.5.7 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | Daniel Gottlieb (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Backport Requested: |
v3.4
|
||||||||
| Sprint: | Storage 2017-04-17, Storage 2017-05-08 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
The LockManager was used for ephemeralForTest reader/writer locks, but the LockManager has a limitation on the number of locks that can be taken by one thread at a time. Exceeding that limit now causes an exception to be thrown. Exceptions cannot safely escape catch blocks. `rollback` methods are called from within catch blocks and thus in no circumstances can throw. By implication, rollback methods cannot acquire locks managed by the LockManager. The simple fix here is to replace the RW lock with a std[x]::mutex. This will prevent concurrent readers when using ephemeralForTest. However, because the critical section is fast and using a std::mutex is likely to be faster than managing RW locks, there may be no performance loss at all. |
| Comments |
| Comment by Githook User [ 05/Jul/17 ] |
|
Author: {u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@mongodb.com'}Message: RecordStores that don't implement document level locking are typically This patch forces the thread-safety requirement into the RecordStore. (cherry picked from commit 71a149b45c8bb019cbc8179f4a411be66bda2062) |
| Comment by Githook User [ 25/Apr/17 ] |
|
Author: {u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}Message: |