[SERVER-78971] Skip shutting down Grid::getExecutorPool() when TestProctor is disabled Created: 14/Jul/23  Updated: 29/Oct/23  Resolved: 17/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc8, 6.0.10, 5.0.21

Type: Bug Priority: Major - P3
Reporter: Jason Chan Assignee: Alex Li
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-50612 ScopedTaskExecutor violates the TaskE... Open
is related to SERVER-67732 mongod shutdown procedure doesn't shu... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Service Arch 2023-07-24
Participants:
Linked BF Score: 104

 Description   

SERVER-67732 introduced shutting down Grid::getExecutorPool() as part of server shutdown as a way to fix memory leaks. However, this can cause a race condition where sharding components that use ScopedTaskExecutor may not be shut down before the parent executor, which makes us hit this invariant as part of server shutdown.

Since having memory leaks during shutdown is more desired than crashing at shutdown, we should skip shutting down the sharding executor pool when TestProctor is enabled. This allows us to get the desired behavior in prod, while also having more manageable BF tracking for this issue since invariants are easier to track than memory leaks.



 Comments   
Comment by Githook User [ 22/Aug/23 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'lia394126'}

Message: SERVER-78971 Skip shutting down Grid::getExecutorPool() when TestProctor is disabled
Branch: v5.0
https://github.com/mongodb/mongo/commit/1c42c4527e1537b2d33022e8e0ad16752cf5b927

Comment by Githook User [ 22/Aug/23 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'lia394126'}

Message: SERVER-78971 Skip shutting down Grid::getExecutorPool() when TestProctor is disabled
Branch: v6.0
https://github.com/mongodb/mongo/commit/3d605079b04d2e3576098e99aec4536e9f18cbc6

Comment by Githook User [ 14/Jul/23 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'lia394126'}

Message: SERVER-78971 Skip shutting down Grid::getExecutorPool() when TestProctor is disabled

(cherry picked from commit 5c754fa6a1198cdb18a5bffcc34315d08641388f)
Branch: v7.0
https://github.com/mongodb/mongo/commit/363d4f314f708cbe6cc8b951894efcf1b28786b8

Comment by Githook User [ 14/Jul/23 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'lia394126'}

Message: SERVER-78971 Skip shutting down Grid::getExecutorPool() when TestProctor is disabled
Branch: master
https://github.com/mongodb/mongo/commit/5c754fa6a1198cdb18a5bffcc34315d08641388f

Generated at Thu Feb 08 06:39:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.