[SERVER-40485] MigrationManager::_schedule should handle TaskExecutor join/cancel Created: 04/Apr/19  Updated: 17/May/19  Resolved: 17/May/19

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

Type: Bug Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Blake Oler
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Sharding 2019-05-20, Sharding 2019-06-03
Participants:

 Description   

See here. It looks like this code will go ahead with trying to complete a migration even during shutdown. The use of ThreadClient might potentially trigger this invariant during the join of the TaskExecutor.



 Comments   
Comment by Benjamin Caimano (Inactive) [ 17/May/19 ]

Talked it over with blake.oler, it turns out that after SERVER-40795 this won't be an issue anymore. This uses the Grid TaskExecutorPool's fixed executor which is a ShardingTaskExecutor. ShardingTaskExecutor wraps ThreadPoolTaskExecutor which now guarantees that all callbacks will be run OutOfLine. There are a lot of hops here, an uncomfortable amount really. Still, it should be safe in the 4.2 world.

Comment by Kaloian Manassiev [ 19/Apr/19 ]

4.1 Required because this can lead to crash on shutdown.

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