code: private Task taskToBeRescheduled(Task task) {
          Task taskToBeRetried = task.copy();
          taskToBeRetried.setTaskId(IDGenerator.generate());
          taskToBeRetried.setRetriedTaskId(task.getTaskId());
          taskToBeRetried.setStatus(SCHEDULED);
          taskToBeRetried.setRetryCount(task.getRetryCount() + 1);
          taskToBeRetried.setRetried(false);
          taskToBeRetried.setPollCount(0);
          taskToBeRetried.setCallbackAfterSeconds(0);
          task.setRetried(true);
          return taskToBeRetried;
      }
docs: Reschedule a task
  
  @param task failed or cancelled task
  @return new instance of a task with "SCHEDULED" status