[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:
Backports
Depends
Duplicate
is duplicated by SERVER-48592 Fix use-after-free ClockSourceMock bu... Closed
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: SERVER-48654 TransactionCoordinatorMetricsTest should install mock tick source before starting WaitF

(cherry picked from commit 8880c88ed5503e88ec88729a621d41224ebdc5a2)
Branch: v4.4
https://github.com/mongodb/mongo/commit/69cfe02a24587d1b822037c9a53d069ac76fb6f6

Comment by Githook User [ 18/Jun/20 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com'}

Message: SERVER-48654 TransactionCoordinatorMetricsTest should install mock tick source before starting WaitF
Branch: master
https://github.com/mongodb/mongo/commit/8880c88ed5503e88ec88729a621d41224ebdc5a2

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()

Generated at Thu Feb 08 05:17:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.