o-nikolas commented on code in PR #75253:
URL: https://github.com/apache/airflow/pull/75253#discussion_r4498608304


##########
task-sdk/src/airflow/sdk/execution_time/callback_supervisor.py:
##########
@@ -527,9 +534,23 @@ def supervise_callback(
                 exit_code=exit_code,
                 duration=end - start,
             )
-            if exit_code != 0:
-                raise RuntimeError(f"Callback subprocess exited with code 
{exit_code}")
-            return exit_code
+            if exit_code == 0:
+                terminal_state = CallbackTerminalState.SUCCESS
+            else:
+                terminal_output = f"Callback subprocess exited with code 
{exit_code}"
+        except Exception as e:
+            terminal_output = f"Callback supervisor error: {type(e).__name__}: 
{e}"
+            log.exception("Callback supervisor error", workload_id=id)

Review Comment:
   nit: this `log.exception` plus `raise` gives two tracebacks for the same 
error, because the caller logs it too (LocalExecutor logs `Workload execution 
failed.` with the exception). Could you drop the log here and just record 
`terminal_output`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to