Descriptionswarming: add transaction_id to tasks.new request
tasks.new RPCs are not safe to repeat on transient errors beacuse tasks.new is
not idempotent. Also it is possible that a task creation request was served, but
the client did not receieve the response due to network. In this case it is not
possible to ensure the task does not exist.
Add transaction_id to NewTaskRequest. It serves two purposes:
- it makes tasks.new API "more" idempotent: if a second request with the same
transaction id is received and a task already exists, the handler reuses
existing task. This allow a client to retry tasks.new requests on transient
failures.
- serves as a second, temporary, identity of the task: a user can cancel a task
by transaction id.
Internally task_id is stored in the memcache entry with a key derived from
transaction id.
Also this CL fixes some tests.
R=maruel@chromium.org, vadimsh@chromium.org
BUG=713307
Patch Set 1 #
Total comments: 16
Patch Set 2 : memcache ns and mock enqueue task #Patch Set 3 : clone arg #Patch Set 4 : cancel_by_transaction_id #Patch Set 5 : nits #
Total comments: 1
Messages
Total messages: 21 (12 generated)
|