@@ -107,33 +107,42 @@ class IndexingWatchdogTerminalStatus(str, Enum):
107
107
# the watchdog terminated the task due to no activity
108
108
TERMINATED_BY_ACTIVITY_TIMEOUT = "terminated_by_activity_timeout"
109
109
110
+ OUT_OF_MEMORY = "out_of_memory"
111
+
110
112
@property
111
113
def code (self ) -> int :
112
114
_ENUM_TO_CODE : dict [IndexingWatchdogTerminalStatus , int ] = {
115
+ IndexingWatchdogTerminalStatus .OUT_OF_MEMORY : 137 ,
113
116
IndexingWatchdogTerminalStatus .BLOCKED_BY_DELETION : 248 ,
114
117
IndexingWatchdogTerminalStatus .BLOCKED_BY_STOP_SIGNAL : 249 ,
115
118
IndexingWatchdogTerminalStatus .FENCE_NOT_FOUND : 250 ,
116
119
IndexingWatchdogTerminalStatus .FENCE_READINESS_TIMEOUT : 251 ,
117
120
IndexingWatchdogTerminalStatus .FENCE_MISMATCH : 252 ,
118
121
IndexingWatchdogTerminalStatus .TASK_ALREADY_RUNNING : 253 ,
119
122
IndexingWatchdogTerminalStatus .INDEX_ATTEMPT_MISMATCH : 254 ,
123
+ IndexingWatchdogTerminalStatus .CONNECTOR_EXCEPTIONED : 255 ,
120
124
}
121
125
122
126
return _ENUM_TO_CODE [self ]
123
127
124
128
@classmethod
125
129
def from_code (cls , code : int ) -> "IndexingWatchdogTerminalStatus" :
126
130
_CODE_TO_ENUM : dict [int , IndexingWatchdogTerminalStatus ] = {
131
+ 137 : IndexingWatchdogTerminalStatus .OUT_OF_MEMORY ,
127
132
248 : IndexingWatchdogTerminalStatus .BLOCKED_BY_DELETION ,
128
133
249 : IndexingWatchdogTerminalStatus .BLOCKED_BY_STOP_SIGNAL ,
129
134
250 : IndexingWatchdogTerminalStatus .FENCE_NOT_FOUND ,
130
135
251 : IndexingWatchdogTerminalStatus .FENCE_READINESS_TIMEOUT ,
131
136
252 : IndexingWatchdogTerminalStatus .FENCE_MISMATCH ,
132
137
253 : IndexingWatchdogTerminalStatus .TASK_ALREADY_RUNNING ,
133
138
254 : IndexingWatchdogTerminalStatus .INDEX_ATTEMPT_MISMATCH ,
139
+ 255 : IndexingWatchdogTerminalStatus .CONNECTOR_EXCEPTIONED ,
134
140
}
135
141
136
- return _CODE_TO_ENUM [code ]
142
+ if code in _CODE_TO_ENUM :
143
+ return _CODE_TO_ENUM [code ]
144
+
145
+ return IndexingWatchdogTerminalStatus .UNDEFINED
137
146
138
147
139
148
class SimpleJobResult :
@@ -832,7 +841,9 @@ def process_job_result(
832
841
)
833
842
)
834
843
else :
835
- result .status = IndexingWatchdogTerminalStatus .CONNECTOR_EXCEPTIONED
844
+ if result .exit_code is not None :
845
+ result .status = IndexingWatchdogTerminalStatus .from_code (result .exit_code )
846
+
836
847
result .exception_str = job .exception ()
837
848
838
849
return result
0 commit comments