Uploaded image for project: 'REEF'
  1. REEF
  2. REEF-865

RunningTaskImpl should close tasks in both INIT and RUNNING status

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.14
    • Fix Version/s: 0.14
    • Component/s: REEF-Common
    • Labels:
      None

      Description

      `TaskRepresenter` is initially created in ReefServiceProtos.State.INIT status and the current implementation of `RunningTaskImpl` can not close a task if its status is not RUNNING status. This was the main root cause of `testFailTaskClose` failures in Dockerized environment. In a slow machine environment, `testFailTaskClose` calls `close` on a task with INIT status and the action is simply ignored. As a result, `testFailTaskClose` fails with TIMEOUT.

      This issue make `RunningTaskImpl` can close a task with INIT or RUNNING.

         public void close() {
           LOG.log(Level.FINEST, "CLOSE: TaskRuntime id[" + taskId + "] on evaluator id[" + evaluatorManager.getId() + "]");
       
      -    if (this.taskRepresenter.isNotRunning()) {
      -      LOG.log(Level.FINE, "Ignoring call to .close() because the task is no longer RUNNING.");
      -    } else {
      +    if (this.taskRepresenter.isClosable()) {
             final ContextControlProto contextControlProto = ContextControlProto.newBuilder()
                 .setStopTask(StopTaskProto.newBuilder().build())
                 .build();
             this.evaluatorManager.sendContextControlMessage(contextControlProto);
      +    } else {
      +      LOG.log(Level.FINE, "Ignoring call to .close() because the task is no longer RUNNING.");
           }
         }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dongjoon Dongjoon Hyun
                Reporter:
                dongjoon Dongjoon Hyun
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: