[SERVER-48654] TransactionCoordinatorMetricsTest should install mock tick source before starting WaitForMajorityService Created: 08/Jun/20 Updated: 29/Oct/23 Resolved: 18/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jack Mulrow | Assignee: | Luis Osta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-interns-2020, sharding-wfbf-day, thread-sanitizer | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||
| Sprint: | Sharding 2020-06-15, Sharding 2020-06-29 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||
| Description |
|
TransactionCoordinatorMetricsTest::setUp() sets a MockTickSource on the service context after calling TransactionCoordinatorTestBase::setUp(). This sets up the TransactionCoordinatorTestFixture, which begins the WaitForMajorityService, which spawns a thread that creates operation contexts, which accesses the service context's tick source. The tick source isn't protected by a mutex, so this is a data race. Setting the mock tick source before setting up the WaitForMajorityService should avoid this. |
| Comments |
| Comment by Githook User [ 17/Sep/20 ] |
|
Author: {'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}Message: (cherry picked from commit 8880c88ed5503e88ec88729a621d41224ebdc5a2) |
| Comment by Githook User [ 18/Jun/20 ] |
|
Author: {'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com'}Message: |
| Comment by Jack Mulrow [ 17/Jun/20 ] |
|
luis.osta as far as I can tell the MockTickSource is only used by TransactionCoordinatorMetricsTest so I think it's fine to just flip the order in TransactionCoordinatorMetricsTest::setup() |