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 2021/09/01 14:52:50 UTC

[GitHub] [airflow] Narendra-Neerukonda opened a new pull request #17967: logs task launch exception in standard task runner

Narendra-Neerukonda opened a new pull request #17967:
URL: https://github.com/apache/airflow/pull/17967


   
   closes: #17966 
   
   Adds an error log message to task runner when task launch fails with error code 1
   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] Narendra-Neerukonda commented on pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
Narendra-Neerukonda commented on pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#issuecomment-911244022


   commit updated as per suggestions from @xinbinhuang and @uranusjr 


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] github-actions[bot] commented on pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#issuecomment-911259015


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] uranusjr commented on a change in pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700772484



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.error(repr(task_launch_exception))

Review comment:
       I’d want this to be
   
   ```python
   self.log.exception("some human-readable description about the situation")
   ```
   
   The `.exception` call automatically includes information of the caught exception so you don’t need to render the exception manually.

##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.error(repr(task_launch_exception))

Review comment:
       I’d want this to be
   
   ```python
   self.log.exception("some human-readable description about the situation")
   ```
   
   The `.exception` call automatically includes information of the caught exception so you don’t need to render the exception manually.
   
   https://docs.python.org/3/library/logging.html#logging.exception




-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] uranusjr commented on a change in pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700772484



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.error(repr(task_launch_exception))

Review comment:
       I’d want this to be
   
   ```python
   self.log.exception("some human-readable description about the situation")
   ```




-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#issuecomment-912506717


   Awesome work, congrats on your first merged pull request!
   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] Narendra-Neerukonda commented on a change in pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
Narendra-Neerukonda commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700783561



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.exception(task_launch_exception)

Review comment:
       @uranusjr  updated commit




-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] xinbinhuang commented on a change in pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
xinbinhuang commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700755625



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.error(repr(task_launch_exception))

Review comment:
       ```suggestion
                   self.log.error(task_launch_exception)
   ```




-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] uranusjr commented on a change in pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700779016



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
             try:
                 args.func(args, dag=self.dag)
                 return_code = 0
-            except Exception:
+            except Exception as task_launch_exception:
+                self.log.exception(task_launch_exception)

Review comment:
       This will show `task_launch_exception` *twice*. The message should be something else, e.g.
   
   ```python
   try:
       ...
   except Exception:
       self.log.exception(
           "Failed to execute job %s fo task %s",
           self._task_instance.job_id,
           self._task_instance.task_id,
       )
   ```




-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ashb merged pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
ashb merged pull request #17967:
URL: https://github.com/apache/airflow/pull/17967


   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] uranusjr commented on pull request #17967: logs task launch exception in standard task runner

Posted by GitBox <gi...@apache.org>.
uranusjr commented on pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#issuecomment-911257640


   Please fix the linter error. It’s be best if you could set up pre-commit locally and check the commit before pushing 🙂 


-- 
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-unsubscribe@airflow.apache.org

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