Reject lease modifications that specify wrong ETA
This prevents a worker that does not currently hold a lease from
updating the task lease. Without this check, it may shorten the
lease for another holder.
@@ -843,7 +843,8 @@ class DistributedTaskQueue():
except QueueNotFound as error:
return '', TaskQueueServiceError.UNKNOWN_QUEUE, str(error)
- task_info = {'id': request.task_name()}
+ task_info = {'id': request.task_name(),
+ 'leaseTimestamp': request.eta_usec()}
try:
# The Python AppServer sets eta_usec with a resolution of 1 second,
# so update_lease can't be used. It checks with millisecond precision.
