Remove use of ObjectID transport flag (#7699)

This commit is contained in:
Edward Oakes
2020-05-17 11:29:49 -05:00
committed by GitHub
parent acffdb2349
commit 16f48078d9
40 changed files with 135 additions and 384 deletions
+4 -8
View File
@@ -85,14 +85,10 @@ def get_async(object_id):
# A hack to keep reference to the future so it doesn't get GC.
user_future.retry_plasma_future = retry_plasma_future
if object_id.is_direct_call_type():
inner_future = loop.create_future()
# We must add the done_callback before sending to in_memory_store_get
inner_future.add_done_callback(done_callback)
core_worker.in_memory_store_get_async(object_id, inner_future)
else:
inner_future = as_future(object_id)
inner_future.add_done_callback(done_callback)
inner_future = loop.create_future()
# We must add the done_callback before sending to in_memory_store_get
inner_future.add_done_callback(done_callback)
core_worker.in_memory_store_get_async(object_id, inner_future)
# A hack to keep reference to inner_future so it doesn't get GC.
user_future.inner_future = inner_future
# A hack to keep a reference to the object ID for ref counting.
-1
View File
@@ -126,7 +126,6 @@ export type RayletInfoResponse = {
children: RayletInfoResponse["actors"];
// currentTaskFuncDesc: string[];
ipAddress: string;
isDirectCall: boolean;
jobId: string;
nodeId: string;
numExecutedTasks: number;
-3
View File
@@ -612,7 +612,6 @@ class NodeStats(threading.Thread):
"children": {},
"currentTaskFuncDesc": [],
"ipAddress": "",
"isDirectCall": False,
"jobId": "",
"numExecutedTasks": 0,
"numLocalObjects": 0,
@@ -782,7 +781,6 @@ class NodeStats(threading.Thread):
self._addr_to_extra_info_dict[addr] = {
"jobId": actor_data["JobID"],
"state": actor_data["State"],
"isDirectCall": actor_data["IsDirectCall"],
"timestamp": actor_data["Timestamp"]
}
@@ -826,7 +824,6 @@ class NodeStats(threading.Thread):
"jobId": ray.utils.binary_to_hex(
actor_data.job_id),
"state": actor_data.state,
"isDirectCall": True,
"timestamp": actor_data.timestamp
}
else:
-1
View File
@@ -75,7 +75,6 @@ cdef extern from "ray/core_worker/core_worker.h" nogil:
CJobID CreationJobID() const
CLanguage ActorLanguage() const
CFunctionDescriptor ActorCreationTaskFunctionDescriptor() const
c_bool IsDirectCallActor() const
c_string ExtensionData() const
cdef cppclass CCoreWorker "ray::CoreWorker":
-6
View File
@@ -150,12 +150,6 @@ cdef extern from "ray/common/id.h" namespace "ray" nogil:
c_bool is_put()
c_bool IsDirectCallType()
CObjectID WithPlasmaTransportType()
CObjectID WithDirectTransportType()
int64_t ObjectIndex() const
CTaskID TaskId() const
+1 -4
View File
@@ -168,9 +168,6 @@ cdef class ObjectID(BaseID):
def hex(self):
return decode(self.data.Hex())
def is_direct_call_type(self):
return self.data.IsDirectCallType()
def is_nil(self):
return self.data.IsNil()
@@ -186,7 +183,7 @@ cdef class ObjectID(BaseID):
@classmethod
def from_random(cls):
return cls(CObjectID.FromRandom().WithDirectTransportType().Binary())
return cls(CObjectID.FromRandom().Binary())
def __await__(self):
# Delayed import because this can only be imported in py3.
+4 -7
View File
@@ -125,13 +125,10 @@ class SerializationContext:
self.add_contained_object_id(obj)
owner_id = ""
owner_address = ""
# TODO(swang): Remove this check. Otherwise, we will not be able to
# handle serialized plasma IDs correctly.
if obj.is_direct_call_type():
worker = ray.worker.global_worker
worker.check_connected()
obj, owner_id, owner_address = (
worker.core_worker.serialize_and_promote_object_id(obj))
worker = ray.worker.global_worker
worker.check_connected()
obj, owner_id, owner_address = (
worker.core_worker.serialize_and_promote_object_id(obj))
obj = id_serializer(obj)
owner_id = id_serializer(owner_id) if owner_id else owner_id
return (obj, owner_id, owner_address)
-1
View File
@@ -333,7 +333,6 @@ class GlobalState:
"IPAddress": actor_table_data.owner_address.ip_address,
"Port": actor_table_data.owner_address.port
},
"IsDirectCall": True,
"State": actor_table_data.state,
"Timestamp": actor_table_data.timestamp,
}
+1 -1
View File
@@ -113,7 +113,7 @@ def test_get_throws_quickly_when_found_exception(ray_start_regular):
ray.get(signal1.send.remote())
signal2 = SignalActor.remote()
actor = Actor.options(is_direct_call=True, max_concurrency=2).remote()
actor = Actor.options(max_concurrency=2).remote()
expect_exception(
[actor.bad_func2.remote(),
actor.slow_func.remote(signal2)], ray.exceptions.RayActorError)
+10 -7
View File
@@ -18,7 +18,14 @@ logger = logging.getLogger(__name__)
@pytest.fixture
def one_worker_100MiB(request):
yield ray.init(num_cpus=1, object_store_memory=100 * 1024 * 1024)
config = json.dumps({
"object_store_full_max_retries": 2,
"task_retry_delay_ms": 0,
})
yield ray.init(
num_cpus=1,
object_store_memory=100 * 1024 * 1024,
_internal_config=config)
ray.shutdown()
@@ -33,12 +40,8 @@ def _fill_object_store_and_get(oid, succeed=True, object_MiB=40,
if succeed:
ray.get(oid)
else:
if oid.is_direct_call_type():
with pytest.raises(ray.exceptions.RayTimeoutError):
ray.get(oid, timeout=0.1)
else:
with pytest.raises(ray.exceptions.UnreconstructableError):
ray.get(oid)
with pytest.raises(ray.exceptions.RayTimeoutError):
ray.get(oid, timeout=0.1)
def _check_refcounts(expected):
@@ -18,7 +18,6 @@ logger = logging.getLogger(__name__)
@pytest.fixture
def one_worker_100MiB(request):
config = json.dumps({
"distributed_ref_counting_enabled": 1,
"object_store_full_max_retries": 2,
"task_retry_delay_ms": 0,
})
@@ -40,12 +39,8 @@ def _fill_object_store_and_get(oid, succeed=True, object_MiB=40,
if succeed:
ray.get(oid)
else:
if oid.is_direct_call_type():
with pytest.raises(ray.exceptions.RayTimeoutError):
ray.get(oid, timeout=0.1)
else:
with pytest.raises(ray.exceptions.UnreconstructableError):
ray.get(oid)
with pytest.raises(ray.exceptions.RayTimeoutError):
ray.get(oid, timeout=0.1)
# Test that an object containing object IDs within it pins the inner IDs
+1
View File
@@ -233,6 +233,7 @@ def run(run_or_experiment,
space = {"lr": tune.uniform(0, 1), "momentum": tune.uniform(0, 1)}
tune.run(my_trainable, config=space, stop={"training_iteration": 10})
"""
pass # XXX: force CI
trial_executor = trial_executor or RayTrialExecutor(
queue_trials=queue_trials,
reuse_actors=reuse_actors,