[Java] Fix some potential bugs about Ray.shutdown() (#5693)

This commit is contained in:
Kai Yang
2019-09-24 10:44:17 +08:00
committed by Hao Chen
parent a4659a8f8b
commit c580955840
5 changed files with 18 additions and 3 deletions
@@ -33,6 +33,10 @@ public class RayDevRuntime extends AbstractRayRuntime {
@Override
public void shutdown() {
if (taskSubmitter != null) {
((LocalModeTaskSubmitter) taskSubmitter).shutdown();
taskSubmitter = null;
}
taskExecutor = null;
}
@@ -133,6 +133,7 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
}
if (null != manager) {
manager.cleanup();
manager = null;
}
}
@@ -210,6 +210,10 @@ public class LocalModeTaskSubmitter implements TaskSubmitter {
}
}
public void shutdown() {
exec.shutdown();
}
public static ActorId getActorId(TaskSpec taskSpec) {
ByteString actorId = null;
if (taskSpec.getType() == TaskType.ACTOR_CREATION_TASK) {