Remove experimental.NoReturn (#7475)

This commit is contained in:
Edward Oakes
2020-03-09 11:09:36 -07:00
committed by GitHub
parent 27b4ffa98e
commit b4e2d5317e
3 changed files with 3 additions and 26 deletions
+1 -11
View File
@@ -91,7 +91,6 @@ from ray.exceptions import (
ObjectStoreFullError,
RayTimeoutError,
)
from ray.experimental.no_return import NoReturn
from ray.utils import decode
cimport cpython
@@ -998,7 +997,6 @@ cdef class CoreWorker:
c_owner_id,
c_owner_address)
# TODO: handle noreturn better
cdef store_task_outputs(
self, worker, outputs, const c_vector[CObjectID] return_ids,
c_vector[shared_ptr[CRayObject]] *returns):
@@ -1016,10 +1014,6 @@ cdef class CoreWorker:
if isinstance(output, ray.actor.ActorHandle):
raise Exception("Returning an actor handle from a remote "
"function is not allowed).")
elif output is NoReturn:
serialized_objects.append(output)
data_sizes.push_back(0)
metadatas.push_back(string_to_buffer(b''))
else:
context = worker.get_serialization_context()
serialized_object = context.serialize(output)
@@ -1036,11 +1030,7 @@ cdef class CoreWorker:
for i, serialized_object in enumerate(serialized_objects):
# A nullptr is returned if the object already exists.
if returns[0][i].get() == NULL:
continue
if serialized_object is NoReturn:
returns[0][i].reset()
else:
if returns[0][i].get() != NULL:
write_serialized_object(
serialized_object, returns[0][i].get().GetData())
-11
View File
@@ -1,11 +0,0 @@
class NoReturn:
"""Do not store the return value in the object store.
If a task returns this object, then Ray will not store this object in the
object store. Calling `ray.get` on the task's return ObjectIDs may block
indefinitely unless the task manually stores an object for the
corresponding ObjectID.
"""
def __init__(self):
raise TypeError("The `NoReturn` object should not be instantiated")