[SERVER-53452] Cleanup order in Grid::clearForUnitTests can cause access to freed memory Created: 18/Dec/20  Updated: 29/Oct/23  Resolved: 11/Jan/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-54363 Tests using ShardServerTestFixture ca... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-01-11, Sharding 2021-01-25
Participants:
Linked BF Score: 45

 Description   

Currently, clearForUnitTests clears the catalog client before the catalog cache. When it's CatalogCache to call it's destructor, it also tries to wait for all the pending task to complete. One of the possible tasks are calls to _lookupDatabase, which can eventually call ShardingCatalogClient::getDatabase.



 Comments   
Comment by Githook User [ 11/Jan/21 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-53452: Reverse order of cleanup in Grid::clearForUnitTests.
Branch: master
https://github.com/mongodb/mongo/commit/313e65435979962d4ba7edc4c83a4dc1cb2078f0

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