avkirilishin commented on code in PR #36986:
URL: https://github.com/apache/airflow/pull/36986#discussion_r1466938501


##########
airflow/models/taskinstance.py:
##########
@@ -2393,6 +2393,12 @@ def _run_raw_task(
                 self.handle_failure(e, test_mode, context, session=session)
                 session.commit()
                 raise
+            except SystemExit as code:
+                self.handle_failure(
+                    f"Task failed due to SystemExit({code})", test_mode, 
context, session=session
+                )
+                session.commit()
+                raise

Review Comment:
   > Then we should fix it.
   
   Of course! This PR aims to do just that.
   
   I've made adjustments. And now handling of system exit in tasks works like 
this:
   * Exiting with a zero or None code signifies success, and the task does not 
return any value.
   * Exiting with other codes signifies an error.
   
   @potiuk @dirrao @hussein-awala, can you take a look please?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to