def _retry_create_task(self, response, op):
    tries = 0
    while (tries < _WORKER_LOCKED_MAX_RETRIES):
        tries += 1
        _LOG.info('Worker locked; retrying (tries: %s)', tries)
        (code, response) = _WorkerPool.create_task(op)
        if (not self._worker_locked(response)):
            return (code, response)
    return (code, {_PAYLOAD: _WORKER_LOCKED})
def _retry_create_task(self, response, op):
    tries = 0
    while (tries < _WORKER_LOCKED_MAX_RETRIES):
        tries += 1
        _LOG.info('Worker locked; retrying (tries: %s)', tries)
        (code, response) = _WorkerPool.create_task(op)
        if (not self._worker_locked(response)):
            return (code, response)
    return (code, {_PAYLOAD: _WORKER_LOCKED})