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

RunningTaskImpl should close tasks in both INIT and RUNNING status

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.14
    • 0.14
    • REEF-Common
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: