Skip to content

Commit

Permalink
Move the error check to core_worker.cc
Browse files Browse the repository at this point in the history
Signed-off-by: Mengjin Yan <mengjinyan3@gmail.com>
  • Loading branch information
MengjinYan committed Nov 12, 2024
1 parent eeba114 commit 01f5f11
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 1 addition & 5 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3831,11 +3831,7 @@ cdef class CoreWorker:
c_vector[CObjectID] free_ids = ObjectRefsToVector(object_refs)

with nogil:
status = CCoreWorkerProcess.GetCoreWorker().Delete(free_ids, local_only)
if status.IsIOError():
check_status(CRayStatus.UnexpectedSystemExit(status.ToString()))
else:
check_status(status)
check_status(CCoreWorkerProcess.GetCoreWorker().Delete(free_ids, local_only))

def get_local_ongoing_lineage_reconstruction_tasks(self):
cdef:
Expand Down
7 changes: 6 additions & 1 deletion src/ray/core_worker/core_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,12 @@ Status CoreWorker::Delete(const std::vector<ObjectID> &object_ids, bool local_on
}
}
// Also try to delete all objects locally.
return DeleteImpl(object_ids, local_only);
Status status = DeleteImpl(object_ids, local_only);
if (status.IsIOError()) {
return Status::UnexpectedSystemExit(status.ToString());
} else {
return status;
}
}

Status CoreWorker::GetLocationFromOwner(
Expand Down
5 changes: 5 additions & 0 deletions src/ray/core_worker/core_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,11 @@ class CoreWorker : public rpc::CoreWorkerServiceHandler {
/// This calls DeleteImpl() locally for objects we own, and DeleteImpl() remotely
/// for objects we do not own.
///
/// If IOError is returned from DeleteImpl() when deleting objects locally, we will
/// return an UnexpectedSystemExit status instead. This is to make sure the tasks
/// that calls this function in application code can properly retry when hitting the
/// IOError.
///
/// \param[in] object_ids IDs of the objects to delete.
/// \param[in] local_only Whether only delete the objects in local node, or all nodes in
/// the cluster.
Expand Down

0 comments on commit 01f5f11

Please sign in to comment.