@@ -39,8 +39,16 @@ constexpr int64_t kTaskFailureThrottlingThreshold = 50;
39
39
// Throttle task failure logs to once this interval.
40
40
constexpr int64_t kTaskFailureLoggingFrequencyMillis = 5000 ;
41
41
42
- static inline rpc::ErrorType MapStatusToErrorType (const Status &status) {
42
+ namespace {
43
+
44
+ rpc::ErrorType MapPlasmaPutStatusToErrorType (const Status &status) {
45
+ // Only the following should be returned from plasma put paths today.
46
+ RAY_DCHECK (status.IsObjectStoreFull () || status.IsTransientObjectStoreFull () ||
47
+ status.IsOutOfDisk () || status.IsIOError ())
48
+ << " Unexpected status from plasma put: " << status;
49
+
43
50
if (status.IsObjectStoreFull () || status.IsTransientObjectStoreFull ()) {
51
+ // TODO(codope): introduce a dedicated OBJECT_STORE_FULL error type and map to it here.
44
52
return rpc::ErrorType::OUT_OF_MEMORY;
45
53
}
46
54
if (status.IsOutOfDisk ()) {
@@ -53,6 +61,8 @@ static inline rpc::ErrorType MapStatusToErrorType(const Status &status) {
53
61
return rpc::ErrorType::WORKER_DIED;
54
62
}
55
63
64
+ } // namespace
65
+
56
66
absl::flat_hash_set<ObjectID> ObjectRefStream::GetItemsUnconsumed () const {
57
67
absl::flat_hash_set<ObjectID> result;
58
68
for (int64_t index = 0 ; index <= max_index_seen_; index++) {
@@ -603,6 +613,7 @@ StatusOr<bool> TaskManager::HandleTaskReturn(const ObjectID &object_id,
603
613
if (!s.ok ()) {
604
614
return s;
605
615
}
616
+ in_memory_store_.Put (RayObject (rpc::ErrorType::OBJECT_IN_PLASMA), object_id);
606
617
} else {
607
618
in_memory_store_.Put (object, object_id);
608
619
direct_return = true ;
@@ -937,7 +948,7 @@ void TaskManager::CompletePendingTask(const TaskID &task_id,
937
948
RAY_LOG (WARNING).WithField (object_id)
938
949
<< " Failed to handle dynamic task return: " << direct_or.status ();
939
950
Status st = direct_or.status ();
940
- rpc::ErrorType err_type = MapStatusToErrorType (st);
951
+ rpc::ErrorType err_type = MapPlasmaPutStatusToErrorType (st);
941
952
rpc::RayErrorInfo err_info;
942
953
err_info.set_error_message (st.ToString ());
943
954
FailOrRetryPendingTask (task_id,
@@ -965,7 +976,7 @@ void TaskManager::CompletePendingTask(const TaskID &task_id,
965
976
// If storing return in plasma failed, treat as system failure for this attempt.
966
977
// Do not proceed with normal completion. Mark task failed immediately.
967
978
Status st = direct_or.status ();
968
- rpc::ErrorType err_type = MapStatusToErrorType (st);
979
+ rpc::ErrorType err_type = MapPlasmaPutStatusToErrorType (st);
969
980
rpc::RayErrorInfo err_info;
970
981
err_info.set_error_message (st.ToString ());
971
982
FailOrRetryPendingTask (task_id,
@@ -1109,7 +1120,7 @@ void TaskManager::CompletePendingTask(const TaskID &task_id,
1109
1120
<< " Failed to handle generator return during app error propagation: "
1110
1121
<< res.status ();
1111
1122
Status st = res.status ();
1112
- rpc::ErrorType err_type = MapStatusToErrorType (st);
1123
+ rpc::ErrorType err_type = MapPlasmaPutStatusToErrorType (st);
1113
1124
rpc::RayErrorInfo err_info;
1114
1125
err_info.set_error_message (st.ToString ());
1115
1126
FailOrRetryPendingTask (spec.TaskId (),
0 commit comments