You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/03 14:00:54 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7232: [AIRFLOW-6569] Flush pending Sentry exceptions before exiting forked process

nuclearpinguin commented on a change in pull request #7232: [AIRFLOW-6569] Flush pending Sentry exceptions before exiting forked process
URL: https://github.com/apache/airflow/pull/7232#discussion_r374117216
 
 

 ##########
 File path: airflow/task/task_runner/standard_task_runner.py
 ##########
 @@ -80,8 +81,11 @@ def _start_by_fork(self):
 
             try:
                 args.func(args, dag=self.dag)
+                # Explicitly flush any pending exception to Sentry if enabled
+                Sentry.flush()
                 os._exit(0)
             except Exception:
+                Sentry.flush()
                 os._exit(1)
 
 Review comment:
   What about:
   ```python
   try:
       args.func(args, dag=self.dag)
       return_code = 0
   except Exception:
       return_code = 1
   finally:
       Sentry.flush()
       os._exit(return_code)
   ```
       

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services