0
votes

When submitting a task from an version, the task ends up in different version for execution. How do I make the task executing in the same deploying version?

Note: I tried 'target' in queue.xml, the result is the same. Tasks will be executed in random different version. It is not always the same.

What's wrong with my setup?

[UPDATE]

  <queue>
    <name>shopinionMessage</name>
    <rate>10/s</rate>
    <retry-parameters>
      <task-retry-limit>60</task-retry-limit>
      <min-backoff-seconds>1</min-backoff-seconds>
      <max-backoff-seconds>30</max-backoff-seconds>
      <max-doublings>0</max-doublings>
    </retry-parameters>
    <target>2</target>
  </queue>
1
Tried the.. what? Have you tried defining a specific <target> on your queue.xml, per the docs about queue configurations? - Ibrahim Arief
Yes, I tried 'target'. However, it did not work. - angelokh
<target> is exactly what you need. If it does not work then this is a bug in GAE and you should fill in a bug report: code.google.com/p/googleappengine/issues/list - Peter Knego

1 Answers

0
votes

https://developers.google.com/appengine/docs/java/config/queue#target says that target is

A string naming a module/version, a frontend version, or a backend, on which to execute this task.

Do you have modules perhaps? If yes, you should try my-version.my-module as target; unfortunately you won't have any luck with that either as of now: https://code.google.com/p/googleappengine/issues/detail?id=10954

By the way, without a target it shouldn't be random regarding where the task is executed:

If target is unspecified, then tasks are invoked on the same version of the application where they were enqueued. So, if you enqueued a task from the default application version without specifying a target on the queue, the task is invoked in the default application version. Note that if the default application version changes between the time that the task is enqueued and the time that it executes, then the task will run in the new default version.