[SERVER-47815] Ensure all exhaust tasks are erased from task executor queue Created: 28/Apr/20  Updated: 29/Oct/23  Resolved: 28/Apr/20

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

Type: Bug Priority: Major - P3
Reporter: Janna Golden Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service arch 2020-05-04
Participants:

 Description   

It is possible that a client receives multiple isMaster responses in quick succession when using the streamable protocol. The task executor layer keeps track of tasks in a queue and holds an iterator pointing to the task. If multiple responses are received super quickly (within about a ms of one another), the later responses can overwrite the iterator value for a task when adding the new task to the queue if the previous responses have not been run yet. This means we would not erase one or more tasks from the task executor's queue because we lose track of the iterator and can hang at shutdown. We can fix this by keeping track of what we expect the iterator to be and compare when running the callback and removing the task, use the appropriate iterator.



 Comments   
Comment by Githook User [ 28/Apr/20 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-47815 Ensure all exhaust tasks are erased from task executor queue
Branch: master
https://github.com/mongodb/mongo/commit/bbc0199f6084ac56dc5ff28f41a277d0d678540b

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