Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.14
-
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
- links to