[SERVER-64509] Fix ShardRegistry threadpool shutdown order Created: 15/Mar/22  Updated: 29/Oct/23  Resolved: 16/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 6.0.0-rc0, 5.0.10

Type: Bug Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
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-64725 Make ShardRegistry::periodicReloader ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.3, v5.0
Sprint: Sharding EMEA 2022-03-21
Participants:
Linked BF Score: 41

 Description   

The ShardRegistry periodic reloader is executed on the ShardRegistry::_executor and down in the stack calls ShardRegistry::_getDataAsync().get(opCtx) this last call will wait for the refresh of the underlying readThroughCache that will be executed on the ShardRegistry::_threadPool.

So the _executor waits on the _threadPool, this means that during shutdown of the ShardRegistry we need first to shutdown the _threadPool and only after we can shutdown and join the _executor.



 Comments   
Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-64509 Fix ShardRegistry threadpool shutdown order

(cherry picked from commit 077b55e6330264b262d87d296a7f7006fece669e)
(cherry picked from commit 6a1b4f309d741385eb49b1f87ebe94a2781c1411)
Branch: v5.0
https://github.com/mongodb/mongo/commit/701795a6dc0a367cb184bf06f844343b31ee884f

Comment by Githook User [ 14/Apr/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-64509 Fix ShardRegistry threadpool shutdown order

(cherry picked from commit 077b55e6330264b262d87d296a7f7006fece669e)
Branch: v5.3
https://github.com/mongodb/mongo/commit/6a1b4f309d741385eb49b1f87ebe94a2781c1411

Comment by Githook User [ 15/Mar/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-64509 Fix ShardRegistry threadpool shutdown order
Branch: master
https://github.com/mongodb/mongo/commit/077b55e6330264b262d87d296a7f7006fece669e

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