ramitkataria commented on code in PR #75253:
URL: https://github.com/apache/airflow/pull/75253#discussion_r4465049977


##########
task-sdk/src/airflow/sdk/execution_time/callback_supervisor.py:
##########
@@ -489,9 +496,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)
+            raise
         finally:
+            try:
+                client.callbacks.finish(UUID(id), state=terminal_state, 
output=terminal_output)

Review Comment:
   Let's also handle this in the same follow-up



-- 
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