Coordinating distributed task execution
AssigneeMicrosoft Technology Licensing, LLC
InventorsXu Wang, Yurong Jiang
Life of this patent
Estimating the term…
Abstract
The disclosed embodiments provide a system for coordinating distributed task execution. During operation, the system retrieves a first batch of tasks from multiple message queues in a distributed messaging system. Next, the system assigns the first batch of tasks to multiple task executors in a thread pool based on availabilities of the multiple task executors. The system also tracks statuses associated with processing the first batch of tasks based on communications from the multiple task executors. The system further periodically commits, based on the tracked statuses, offsets of completed tasks in the multiple message queues to the distributed messaging system.
Claims20
A method comprising:
- retrieving, by a task poller executing on a first processor, a first batch of tasks from multiple message queues in a distributed messaging system;
- assigning, by the task poller, the first batch of tasks to multiple task executors in a thread pool based on availabilities of the multiple task executors;
- tracking, by an offset manager executing on a second processor, statuses associated with processing the first batch of tasks based on communications from the multiple task executors;
- and
- periodically committing, by the offset manager based on the tracked statuses, offsets of completed tasks in the multiple message queues to the distributed messaging system;
- wherein periodically committing the offsets of the completed tasks in the multiple message queues to the distributed messaging system comprises:
- when a pending task blocks completion of a series of tasks represented by sequential offsets that immediately follow a last-committed offset in a message queue:
- notifying a producer of messages in the message queue to resend a message representing the pending task;
- and
- committing, to the distributed messaging system, a highest offset associated with the series of tasks in the message queue.
A system comprising:
- one or more processors;
- and
- memory storing instructions that, when executed by the one or more processors, cause the system to:
- retrieve, by a single-thread process, a first batch of tasks from multiple message queues in a distributed messaging system;
- assign the first batch of tasks to multiple task executors in a thread pool based on availabilities of the multiple task executors;
- track statuses associated with processing the first batch of tasks based on communications from the multiple task executors;
- and
- periodically commit, based on the tracked statuses, offsets of completed tasks in the multiple message queues to the distributed messaging system
- wherein periodically committing the offsets of the completed tasks in the multiple message queues to the distributed messaging system comprises:
- when a pending task blocks completion of a first series of tasks represented by sequential offsets that immediately follow a last-committed offset in a message queue:
- notifying a producer of messages in the message queue to resend a message representing the pending task;
- and
- committing, to the distributed messaging system, a highest offset associated with the first series of tasks in the message queue.
A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method, the method comprising:
- retrieving, by a single-thread process, a first batch of tasks from multiple message queues in a distributed messaging system;
- assigning the first batch of tasks to multiple task executors based on availabilities of the multiple task executors;
- tracking statuses associated with processing the first batch of tasks based on communications from the multiple task executors;
- and
- periodically committing, based on the tracked statuses, offsets of completed tasks in the multiple message queues to the distributed messaging system;
- wherein periodically committing the offsets of the completed tasks in the multiple message queues to the distributed messaging system comprises:
- when a pending task blocks completion of a series of tasks represented by sequential offsets that immediately follow a last-committed offset in a message queue:
- notifying a producer of messages in the message queue to resend a message representing the pending task;
- and
- committing, to the distributed messaging system, a highest offset associated with the series of tasks in the message queue.
Dependencies are inferred from the claim text.