Skip to content

Commit f1914d1

Browse files
author
Richard Kuo (Danswer)
committed
handle "-9"
1 parent cfdd3ef commit f1914d1

File tree

1 file changed

+4
-2
lines changed
  • backend/onyx/background/celery/tasks/indexing

1 file changed

+4
-2
lines changed

backend/onyx/background/celery/tasks/indexing/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@ class IndexingWatchdogTerminalStatus(str, Enum):
109109

110110
OUT_OF_MEMORY = "out_of_memory"
111111

112+
PROCESS_SIGNAL_SIGKILL = "process_signal_sigkill"
113+
112114
@property
113115
def code(self) -> int:
114116
_ENUM_TO_CODE: dict[IndexingWatchdogTerminalStatus, int] = {
117+
IndexingWatchdogTerminalStatus.PROCESS_SIGNAL_SIGKILL: -9,
115118
IndexingWatchdogTerminalStatus.OUT_OF_MEMORY: 137,
116119
IndexingWatchdogTerminalStatus.BLOCKED_BY_DELETION: 248,
117120
IndexingWatchdogTerminalStatus.BLOCKED_BY_STOP_SIGNAL: 249,
@@ -128,7 +131,7 @@ def code(self) -> int:
128131
@classmethod
129132
def from_code(cls, code: int) -> "IndexingWatchdogTerminalStatus":
130133
_CODE_TO_ENUM: dict[int, IndexingWatchdogTerminalStatus] = {
131-
137: IndexingWatchdogTerminalStatus.OUT_OF_MEMORY,
134+
-9: IndexingWatchdogTerminalStatus.PROCESS_SIGNAL_SIGKILL,
132135
248: IndexingWatchdogTerminalStatus.BLOCKED_BY_DELETION,
133136
249: IndexingWatchdogTerminalStatus.BLOCKED_BY_STOP_SIGNAL,
134137
250: IndexingWatchdogTerminalStatus.FENCE_NOT_FOUND,
@@ -728,7 +731,6 @@ def connector_indexing_task(
728731
f"Index attempt not found: index_attempt={index_attempt_id}",
729732
code=IndexingWatchdogTerminalStatus.INDEX_ATTEMPT_MISMATCH.code,
730733
)
731-
# attempt_found = True
732734

733735
cc_pair = get_connector_credential_pair_from_id(
734736
db_session=db_session,

0 commit comments

Comments
 (0)