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/05/30 10:21:59 UTC

[GitHub] [airflow] yuqian90 opened a new pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

yuqian90 opened a new pull request #16167:
URL: https://github.com/apache/airflow/pull/16167


   closes: #16163
   
   This PR silences these two lines of log for tasks that are running because they cause confusion for users. In other words, if a task is already running, do not log saying they can't be run. 
   
   ```
   {taskinstance.py:874} INFO - Dependencies not met for <TaskInstance: ... [running]>, dependency 'Task Instance Not Running' FAILED: Task is in the running state
   {taskinstance.py:874} INFO - Dependencies not met for <TaskInstance: ... [running]>, dependency 'Task Instance State' FAILED: Task is in the 'running' state which is not a valid state for execution. The task must be cleared in order to be run.
   ```


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



[GitHub] [airflow] yuqian90 commented on a change in pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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



##########
File path: airflow/models/taskinstance.py
##########
@@ -864,12 +864,14 @@ def are_dependencies_met(self, dep_context=None, session=None, verbose=False):
         for dep_status in self.get_failed_dep_statuses(dep_context=dep_context, session=session):
             failed = True
 
-            verbose_aware_logger(
-                "Dependencies not met for %s, dependency '%s' FAILED: %s",
-                self,
-                dep_status.dep_name,
-                dep_status.reason,
-            )
+            if self.state != State.RUNNING:
+                # Only log about dependencies for non-running tasks.
+                verbose_aware_logger(
+                    "Dependencies not met for %s, dependency '%s' FAILED: %s",
+                    self,
+                    dep_status.dep_name,
+                    dep_status.reason,
+                )

Review comment:
       Hi @uranusjr , the log currently looks like this:
   
   ```
   Dependencies not met for <TaskInstance: ... [running]>, dependency 'Task Instance Not Running' FAILED: Task is in the running state
   Dependencies not met for <TaskInstance: ... [running]>, dependency 'Task Instance State' FAILED: Task is in the 'running' state which is not a valid state for execution. The task must be cleared in order to be run.
   Task is not able to be run
   ```
   
   I've silenced the first two lines and changed the third line to "Task is still running". I also tried to do what you suggested, but I'm still struggling to think of a way to rephrase the first two lines to make them less confusing. For running tasks, if the only action needed from the user is to wait, maybe it's right to not log anything? 




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



[GitHub] [airflow] yuqian90 closed pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

Posted by GitBox <gi...@apache.org>.
yuqian90 closed pull request #16167:
URL: https://github.com/apache/airflow/pull/16167


   


-- 
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 #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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



##########
File path: airflow/models/taskinstance.py
##########
@@ -864,12 +864,14 @@ def are_dependencies_met(self, dep_context=None, session=None, verbose=False):
         for dep_status in self.get_failed_dep_statuses(dep_context=dep_context, session=session):
             failed = True
 
-            verbose_aware_logger(
-                "Dependencies not met for %s, dependency '%s' FAILED: %s",
-                self,
-                dep_status.dep_name,
-                dep_status.reason,
-            )
+            if self.state != State.RUNNING:
+                # Only log about dependencies for non-running tasks.
+                verbose_aware_logger(
+                    "Dependencies not met for %s, dependency '%s' FAILED: %s",
+                    self,
+                    dep_status.dep_name,
+                    dep_status.reason,
+                )

Review comment:
       I feel we should still log something here, a running state is still dependency not met, it’s just the previous messasge is confusing.




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



[GitHub] [airflow] yuqian90 commented on a change in pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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



##########
File path: airflow/jobs/local_task_job.py
##########
@@ -95,7 +95,9 @@ def signal_handler(signum, frame):
             job_id=self.id,
             pool=self.pool,
         ):
-            self.log.info("Task is not able to be run")
+            if self.task_instance.state != State.RUNNING:
+                # Only log about this for non-running tasks.

Review comment:
       That's a good point. Done.




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



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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



##########
File path: airflow/jobs/local_task_job.py
##########
@@ -95,7 +95,9 @@ def signal_handler(signum, frame):
             job_id=self.id,
             pool=self.pool,
         ):
-            self.log.info("Task is not able to be run")
+            if self.task_instance.state != State.RUNNING:
+                # Only log about this for non-running tasks.

Review comment:
       How about notifying that the task is running?




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



[GitHub] [airflow] uranusjr commented on a change in pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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



##########
File path: airflow/models/taskinstance.py
##########
@@ -864,12 +864,14 @@ def are_dependencies_met(self, dep_context=None, session=None, verbose=False):
         for dep_status in self.get_failed_dep_statuses(dep_context=dep_context, session=session):
             failed = True
 
-            verbose_aware_logger(
-                "Dependencies not met for %s, dependency '%s' FAILED: %s",
-                self,
-                dep_status.dep_name,
-                dep_status.reason,
-            )
+            if self.state != State.RUNNING:
+                # Only log about dependencies for non-running tasks.
+                verbose_aware_logger(
+                    "Dependencies not met for %s, dependency '%s' FAILED: %s",
+                    self,
+                    dep_status.dep_name,
+                    dep_status.reason,
+                )

Review comment:
       Maybe something like `Dependencies not met: task is still running`? This would indicate to the user why the task is not able to be run (so they know they should wait).




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



[GitHub] [airflow] yuqian90 commented on pull request #16167: Silences confusing log for long running tasks: "dependency 'Task Instance Not Running' FAILED: Task is in the running state"

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


   I'm closing this because I realized the cause of the log seems related to `visibility_timeout` setting in airflow.cfg. It probably needs to be increased to a large number, although I haven't been able to successfully changing it. See https://github.com/apache/airflow/issues/16163#issuecomment-868977040


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