Remove task context from python worker (#5987)

Removes duplicated state between the python and C++ workers. Also cleans up the serialization codepaths a bit.
This commit is contained in:
Edward Oakes
2019-10-25 07:38:33 -07:00
committed by GitHub
parent cf16b2f0c4
commit 1ce521a7f3
22 changed files with 331 additions and 425 deletions
+6 -11
View File
@@ -8,7 +8,6 @@ import subprocess
import time
import ray
from ray.utils import _random_string
from ray.tests.utils import (
RayTestTimeoutException,
run_string_as_driver,
@@ -556,14 +555,12 @@ print("success")
# Create some drivers and let them exit and make sure everything is
# still alive.
for _ in range(3):
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
nonexistent_id = ray.ObjectID.from_random()
driver_script = driver_script_template.format(address,
nonexistent_id_hex)
nonexistent_id.hex())
out = run_string_as_driver(driver_script)
# Simulate the nonexistent dependency becoming available.
ray.worker.global_worker.put_object(
ray.ObjectID(nonexistent_id_bytes), None)
ray.worker.global_worker.put_object(None, nonexistent_id)
# Make sure the first driver ran to completion.
assert "success" in out
@@ -583,14 +580,12 @@ print("success")
# Create some drivers and let them exit and make sure everything is
# still alive.
for _ in range(3):
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
nonexistent_id = ray.ObjectID.from_random()
driver_script = driver_script_template.format(address,
nonexistent_id_hex)
nonexistent_id.hex())
out = run_string_as_driver(driver_script)
# Simulate the nonexistent dependency becoming available.
ray.worker.global_worker.put_object(
ray.ObjectID(nonexistent_id_bytes), None)
ray.worker.global_worker.put_object(None, nonexistent_id)
# Make sure the first driver ran to completion.
assert "success" in out