mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 02:01:24 +08:00
Remove object id translation (#6531)
This commit is contained in:
@@ -92,5 +92,7 @@ def get_async(object_id):
|
||||
inner_future.add_done_callback(done_callback)
|
||||
# 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.
|
||||
user_future.object_id = object_id
|
||||
|
||||
return user_future
|
||||
|
||||
@@ -170,9 +170,6 @@ cdef class ObjectID(BaseID):
|
||||
def is_direct_call_type(self):
|
||||
return self.data.IsDirectCallType()
|
||||
|
||||
def with_plasma_transport_type(self):
|
||||
return ObjectID(self.data.WithPlasmaTransportType().Binary())
|
||||
|
||||
def is_nil(self):
|
||||
return self.data.IsNil()
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def test_dying_worker_get(ray_start_2_cpus):
|
||||
assert len(ready_ids) == 0
|
||||
# Seal the object so the store attempts to notify the worker that the
|
||||
# get has been fulfilled.
|
||||
ray.worker.global_worker.put_object(1, x_id.with_plasma_transport_type())
|
||||
ray.worker.global_worker.put_object(1, x_id)
|
||||
time.sleep(0.1)
|
||||
|
||||
# Make sure that nothing has died.
|
||||
@@ -97,7 +97,7 @@ ray.get(ray.ObjectID(ray.utils.hex_to_binary("{}")))
|
||||
assert len(ready_ids) == 0
|
||||
# Seal the object so the store attempts to notify the worker that the
|
||||
# get has been fulfilled.
|
||||
ray.worker.global_worker.put_object(1, x_id.with_plasma_transport_type())
|
||||
ray.worker.global_worker.put_object(1, x_id)
|
||||
time.sleep(0.1)
|
||||
|
||||
# Make sure that nothing has died.
|
||||
@@ -137,7 +137,7 @@ def test_dying_worker_wait(ray_start_2_cpus):
|
||||
time.sleep(0.1)
|
||||
|
||||
# Create the object.
|
||||
ray.worker.global_worker.put_object(1, x_id.with_plasma_transport_type())
|
||||
ray.worker.global_worker.put_object(1, x_id)
|
||||
time.sleep(0.1)
|
||||
|
||||
# Make sure that nothing has died.
|
||||
@@ -180,7 +180,7 @@ ray.wait([ray.ObjectID(ray.utils.hex_to_binary("{}"))])
|
||||
assert len(ready_ids) == 0
|
||||
# Seal the object so the store attempts to notify the worker that the
|
||||
# wait can return.
|
||||
ray.worker.global_worker.put_object(1, x_id.with_plasma_transport_type())
|
||||
ray.worker.global_worker.put_object(1, x_id)
|
||||
time.sleep(0.1)
|
||||
|
||||
# Make sure that nothing has died.
|
||||
|
||||
Reference in New Issue
Block a user