mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
[Java] Fix some potential bugs about Ray.shutdown()
(#5693)
This commit is contained in:
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) {
|
||||
|
|
|
@ -45,13 +45,17 @@ public abstract class BaseMultiLanguageTest {
|
|||
}
|
||||
}
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void setUp() {
|
||||
private void checkMultiLanguageTestFlag() {
|
||||
if (!"1".equals(System.getenv("ENABLE_MULTI_LANGUAGE_TESTS"))) {
|
||||
LOGGER.info("Skip Multi-language tests because environment variable "
|
||||
+ "ENABLE_MULTI_LANGUAGE_TESTS isn't set");
|
||||
throw new SkipException("Skip test.");
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void setUp() {
|
||||
checkMultiLanguageTestFlag();
|
||||
|
||||
// Delete existing socket files.
|
||||
for (String socket : ImmutableList.of(RAYLET_SOCKET_NAME, PLASMA_STORE_SOCKET_NAME)) {
|
||||
|
@ -102,6 +106,8 @@ public abstract class BaseMultiLanguageTest {
|
|||
|
||||
@AfterClass(alwaysRun = true)
|
||||
public void tearDown() {
|
||||
checkMultiLanguageTestFlag();
|
||||
|
||||
// Disconnect to the cluster.
|
||||
Ray.shutdown();
|
||||
System.clearProperty("ray.redis.address");
|
||||
|
|
|
@ -14,7 +14,7 @@ public class BaseTest {
|
|||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BaseTest.class);
|
||||
|
||||
private List<File> filesToDelete;
|
||||
private List<File> filesToDelete = ImmutableList.of();
|
||||
|
||||
@BeforeMethod(alwaysRun = true)
|
||||
public void setUpBase(Method method) {
|
||||
|
|
Loading…
Add table
Reference in a new issue