[SERVER-54363] Tests using ShardServerTestFixture can seg fault if there are outstanding tasks in the CatalogCache Created: 05/Feb/21  Updated: 29/Oct/23  Resolved: 08/Mar/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: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-53452 Cleanup order in Grid::clearForUnitTe... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 45

 Description   

The CatalogCache takes in a loader as a reference. When the fixture calls tearDown, it clears the loader. That means that if the CatalogCache still has pending refresh tasks, it can end up trying to use the loader after it was freed.



 Comments   
Comment by Githook User [ 08/Mar/21 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-54363 Clear the grid before tearing down resharding unittest
...so the catalog cache is freed before the catalog cache loader
Branch: master
https://github.com/mongodb/mongo/commit/3db7832536175fb56b9149203d485746873f912e

Comment by Marcos José Grillo Ramirez [ 04/Mar/21 ]

The catalog cache is using it's own threadpool so, by the time the CatalogCache object is destroyed (on the ShardingMongodFixture) and the outstanding operations joined, the CatalogCacheLoader is already freed. I will discuss with the team about adding a function that will allow joining and shutting down that threadpool for tests (something like the catalog cache loader already has) that can be called BEFORE freeing the loader.

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