@@ -1218,27 +1218,17 @@ def start(self):
12181218 logger .info ("Program finished" )
12191219 signal .alarm (0 )
12201220
1221- # Failure "gate" BEFORE changing status
1222- def is_real_async_failure (r ):
1223- # gather returns either normal values or exception instances when return_exceptions=True
1224- return isinstance (r , BaseException ) and not isinstance (r , asyncio .CancelledError )
1225- had_async_exc = any (is_real_async_failure (r ) for r in task_results )
1226- program_rc = getattr (self , "program_exit_code" , None )
1227- ingestion_rc = getattr (self , "ingestion_program_exit_code" , None )
1228- failed_rc = any (rc not in (0 , None ) for rc in (program_rc , ingestion_rc ))
1229- if had_async_exc or failed_rc :
1230- self ._update_status (
1231- STATUS_FAILED ,
1232- extra_information = f"program_rc={ program_rc } , ingestion_rc={ ingestion_rc } , async={ task_results } " ,
1233- )
1234- # Raise so upstream marks failed immediately
1235- raise SubmissionException ("Child task failed or non-zero return code" )
1236-
1237- logger .info (
1238- "PROGRAM STATUS: is_scoring=%s program_rc=%r ingestion_rc=%r task_results=%r" ,
1239- self .is_scoring , program_rc , ingestion_rc , task_results
1240- )
12411221 if self .is_scoring :
1222+ # Check if scoring program failed
1223+ program_results , _ , _ = task_results
1224+ # Gather returns either normal values or exception instances when return_exceptions=True
1225+ had_async_exc = isinstance (program_results , BaseException ) and not isinstance (program_results , asyncio .CancelledError )
1226+ program_rc = getattr (self , "program_exit_code" , None )
1227+ failed_rc = program_rc not in (0 , None )
1228+ if had_async_exc or failed_rc :
1229+ self ._update_status (STATUS_FAILED , extra_information = f"program_rc={ program_rc } , async={ task_results } " )
1230+ # Raise so upstream marks failed immediately
1231+ raise SubmissionException ("Child task failed or non-zero return code" )
12421232 self ._update_status (STATUS_FINISHED )
12431233 else :
12441234 self ._update_status (STATUS_SCORING )
0 commit comments