Fix the bug of unregistered workers in worker pool (#7343)

* Fix

* Fix

* Fix complie

* Fix lint

* Fix linting

* Fix testDeleteObject

* Fix linting

* Update src/ray/raylet/worker_pool.cc

Co-Authored-By: Hao Chen <chenh1024@gmail.com>

* Update src/ray/raylet/worker_pool.cc

Co-Authored-By: Hao Chen <chenh1024@gmail.com>

* Update src/ray/raylet/worker_pool.h

Co-Authored-By: Hao Chen <chenh1024@gmail.com>

* Update src/ray/raylet/worker_pool.cc

Co-Authored-By: Hao Chen <chenh1024@gmail.com>

* Address comments.

* FIx linting

Co-authored-by: Hao Chen <chenh1024@gmail.com>
This commit is contained in:
Qing Wang
2020-03-02 16:30:39 +08:00
committed by GitHub
parent 0792b5cb93
commit 2771af1036
6 changed files with 61 additions and 11 deletions
@@ -33,6 +33,10 @@ public class TestUtils {
}
}
public static boolean isDirectActorCallEnabled() {
return ActorCreationOptions.DEFAULT_USE_DIRECT_CALL;
}
public static void skipTestIfDirectActorCallEnabled() {
skipTestIfDirectActorCallEnabled(true);
}
@@ -25,9 +25,14 @@ public class PlasmaFreeTest extends BaseTest {
Ray.internal().free(ImmutableList.of(helloId.getId()), true, false);
final boolean result = TestUtils.waitForCondition(() ->
TestUtils.getRuntime().getObjectStore()
.wait(ImmutableList.of(helloId.getId()), 1, 0).get(0) == false, 50);
Assert.assertTrue(result);
!TestUtils.getRuntime().getObjectStore()
.wait(ImmutableList.of(helloId.getId()), 1, 0).get(0), 50);
if (TestUtils.isDirectActorCallEnabled()) {
// Direct call will not delete object from im-memory store.
Assert.assertFalse(result);
} else {
Assert.assertTrue(result);
}
}
@Test