Update task state when max retries is hit