File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
backend/onyx/background/celery/tasks/docfetching Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -552,15 +552,20 @@ def docfetching_proxy_task(
552
552
# print with exception
553
553
try :
554
554
with get_session_with_current_tenant () as db_session :
555
- failure_reason = (
556
- f"Spawned task exceptioned: exit_code={ result .exit_code } "
557
- )
558
- mark_attempt_failed (
559
- ctx .index_attempt_id ,
560
- db_session ,
561
- failure_reason = failure_reason ,
562
- full_exception_trace = result .exception_str ,
563
- )
555
+ attempt = get_index_attempt (db_session , ctx .index_attempt_id )
556
+
557
+ # only mark failures if not already terminal,
558
+ # otherwise we're overwriting potential real stack traces
559
+ if attempt and not attempt .status .is_terminal ():
560
+ failure_reason = (
561
+ f"Spawned task exceptioned: exit_code={ result .exit_code } "
562
+ )
563
+ mark_attempt_failed (
564
+ ctx .index_attempt_id ,
565
+ db_session ,
566
+ failure_reason = failure_reason ,
567
+ full_exception_trace = result .exception_str ,
568
+ )
564
569
except Exception :
565
570
task_logger .exception (
566
571
log_builder .build (
You can’t perform that action at this time.
0 commit comments