Search code examples
google-app-engineobjectifytask-queue

Keeping task queues in chronological order in appengine


In google app engine, as you add tasks to the same push task queue, will they all be queued up one after another chronologically? Or is it possible that a task could be executed before another one although it was added last? (this is all assuming they are using the same queue).


Solution

  • Not necessarily. I can think of 2 cases where that might not happen:

    • tasks can have different ETAs (in the future, for example), the order would normally be the ETA one, see do google app engine pull queues return tasks in FIFO order?

    • task execution may fail (for whatever reason) and they may be automatically re-tried with a backoff scheme (i.e. after some delay). Which means other tasks which normally would run after the failed one may actually run before its retry attempt(s).