Mark worker as blocked and trigger reconstruction in ray.wait. (#2864)

* Trigger reconstruction in ray.wait and mark worker as blocked.

* Add test.

* Linting.

* Don't run new test with legacy Ray.

* Only call HandleClientUnblocked if it actually blocked in ray.wait.

* Reduce time to ray.wait in the test.
This commit is contained in:
Robert Nishihara
2018-09-13 15:28:17 -07:00
committed by Philipp Moritz
parent a1b8e79c30
commit f16d33593b
4 changed files with 108 additions and 51 deletions
+9 -1
View File
@@ -2063,7 +2063,15 @@ class WorkerPoolTests(unittest.TestCase):
object_ids = [f.remote(i, j) for j in range(2)]
return ray.get(object_ids)
ray.get([g.remote(i) for i in range(4)])
@ray.remote
def h(i):
# Each instance of g submits and blocks on the result of another
# remote task using ray.wait.
object_ids = [f.remote(i, j) for j in range(2)]
return ray.wait(object_ids, num_returns=len(object_ids))
if os.environ.get("RAY_USE_XRAY") == "1":
ray.get([h.remote(i) for i in range(4)])
@ray.remote
def _sleep(i):