mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 14:31:15 +08:00
Misc direct call fixes from unit tests (#6394)
This commit is contained in:
+12
-10
@@ -177,9 +177,11 @@ class SerializationContext(object):
|
||||
|
||||
def object_id_deserializer(serialized_obj):
|
||||
obj_id, owner_id, owner_address = pickle.loads(serialized_obj)
|
||||
# Must deserialize the object in the core worker before we
|
||||
# create the ObjectID to ensure that the reference is added
|
||||
# before we increment its count to 1.
|
||||
# NOTE(swang): Must deserialize the object first before asking
|
||||
# the core worker to resolve the value. This is to make sure
|
||||
# that the ref count for the ObjectID is greater than 0 by the
|
||||
# time the core worker resolves the value of the object.
|
||||
deserialized_object_id = obj_id[0](obj_id[1][0])
|
||||
if owner_id:
|
||||
worker = ray.worker.get_global_worker()
|
||||
worker.check_connected()
|
||||
@@ -187,8 +189,7 @@ class SerializationContext(object):
|
||||
# (class name, (unique bytes,)).
|
||||
worker.core_worker.deserialize_and_register_object_id(
|
||||
obj_id[1][0], owner_id[1][0], owner_address)
|
||||
obj_id = obj_id[0](obj_id[1][0])
|
||||
return obj_id
|
||||
return deserialized_object_id
|
||||
|
||||
for id_type in ray._raylet._ID_TYPES:
|
||||
if id_type == ray._raylet.ObjectID:
|
||||
@@ -241,9 +242,11 @@ class SerializationContext(object):
|
||||
|
||||
def object_id_deserializer(serialized_obj):
|
||||
obj_id, owner_id, owner_address = serialized_obj
|
||||
# Must deserialize the object in the core worker before we
|
||||
# create the ObjectID to ensure that the reference is added
|
||||
# before we increment its count to 1.
|
||||
# NOTE(swang): Must deserialize the object first before asking
|
||||
# the core worker to resolve the value. This is to make sure
|
||||
# that the ref count for the ObjectID is greater than 0 by the
|
||||
# time the core worker resolves the value of the object.
|
||||
deserialized_object_id = id_deserializer(obj_id)
|
||||
if owner_id:
|
||||
worker = ray.worker.get_global_worker()
|
||||
worker.check_connected()
|
||||
@@ -251,8 +254,7 @@ class SerializationContext(object):
|
||||
# (class name, (unique bytes,)).
|
||||
worker.core_worker.deserialize_and_register_object_id(
|
||||
obj_id[1][0], owner_id[1][0], owner_address)
|
||||
obj_id = id_deserializer(obj_id)
|
||||
return obj_id
|
||||
return deserialized_object_id
|
||||
|
||||
for id_type in ray._raylet._ID_TYPES:
|
||||
if id_type == ray._raylet.ObjectID:
|
||||
|
||||
Reference in New Issue
Block a user