Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Pull Queue in GAE exhibit consistent FIFO behavior?

The push queue in App Engine is generally a FIFO queue, but as seen from the linked docs, in the case where the queue has a large backlog of tasks, the scheduler might jump new tasks to the head of the queue in an attempt to reduce latency.

This jumping-ahead-of-the-queue makes sense for heavily loaded apps, but it would meant that the FIFO behavior is not guaranteed to be consistent.

Now the question is, how about pull queues? The above behavior makes sense in a push queue, but less so in pull queues, since the responsibility to lease tasks from the pull queue and the responsibility to scale up the number of workers fell to the app itself. If the jumping-ahead-of-the-queue behavior does not exist in pull queues, would it mean that the pull queue is consistently exhibiting a FIFO behavior?

In addition, I cannot seem to find any docs about the ordering of tasks in the official pull queue docs.

like image 814
Ibrahim Arief Avatar asked Sep 14 '12 09:09

Ibrahim Arief


People also ask

What is a pull queue?

In the pull model, a worker service regularly polls the task queue API to discover any pending tasks. As tasks are queued, the worker may pull one or many tasks. This allows workers to process tasks in batches, which is often more efficient for high-volume, lightweight operations than the push model.

What is Google task queue?

Task queues let applications perform work, called tasks, asynchronously outside of a user request. If an app needs to execute work in the background, it adds tasks to task queues. The tasks are executed later, by worker services. The Task Queue service is designed for asynchronous work.


1 Answers

No there are no ordering guarantees in either pull queues.

While typically the tasks with the oldest ETA will be leased first, it is not assured to be the case. You're application should be able to deal with tasked being dequed from your queue in any order.

like image 94
Stuart Langley Avatar answered Oct 01 '22 22:10

Stuart Langley