[SERVER-29829] Possible double call of std::thread::join though Balancer::waitForBalancerToStop Created: 23/Jun/17  Updated: 30/Oct/23  Resolved: 08/Jan/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.10, 3.5.9
Fix Version/s: 4.3.3

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-07-10, Sharding 2017-07-31, Sharding 2017-10-23, Sharding 2017-11-13, Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13
Participants:
Linked BF Score: 0

 Description   

The sharding balancer shutdown process eventually calls Balancer::waitForBalancerToStop in order to wait for the balancer thread to terminate. This method is called both by replication promotion to primary and by the shutdown sequence.

If a node being promoted to primary is shutdown at the same time, it is possible that two calls enter Balancer::waitForBalancerToStop concurrently which will both call std::thread::join, which is not allowed.



 Comments   
Comment by Githook User [ 08/Jan/20 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-29829 Possible double call of std::thread::join through Balancer::waitForBalancerToStop
Branch: master
https://github.com/mongodb/mongo/commit/dd3a688064d3c392b0bcdc500f19d9b40d4659d6

Generated at Thu Feb 08 04:21:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.