You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "collinmcnulty (via GitHub)" <gi...@apache.org> on 2024/03/06 20:41:16 UTC

[PR] Add messages to task log about moving to queued [airflow]

collinmcnulty opened a new pull request, #37951:
URL: https://github.com/apache/airflow/pull/37951

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   
   When troubleshooting a task that failed somewhere other than the main execute function, it is necessary to look across multiple logs and amidst many unrelated messages in the scheduler. This change adds the messages relevant to a particular task to the task log so that the full history of relevant actions across Airflow can be seen from the task log. This is still in its initial stages, and I need to get a better understanding of the performance impact of this logging.
   


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


Re: [PR] Add messages to task log about moving to queued [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37951:
URL: https://github.com/apache/airflow/pull/37951#issuecomment-2071156179

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


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


Re: [PR] Add messages to task log about moving to queued [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37951:
URL: https://github.com/apache/airflow/pull/37951#issuecomment-2365374283

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


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


Re: [PR] Add messages to task log about moving to queued [airflow]

Posted by "RNHTTR (via GitHub)" <gi...@apache.org>.
RNHTTR commented on code in PR #37951:
URL: https://github.com/apache/airflow/pull/37951#discussion_r1576962216


##########
airflow/utils/log/task_context_logger.py:
##########
@@ -78,15 +78,20 @@ def _get_task_handler() -> FileTaskHandler | None:
             assert isinstance(h, FileTaskHandler)
         return h
 
-    def _log(self, level: int, msg: str, *args, ti: TaskInstance):
+    def _log(self, level: int, msg: str, *args, ti: TaskInstance, suppress_in_call_site=False):

Review Comment:
   I think this should be more descriptive. Maybe something like `task_instance_logs_only`?



##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1562,9 +1570,9 @@ def _fail_tasks_stuck_in_queued(self, session: Session = NEW_SESSION) -> None:
             for ti in tasks_stuck_in_queued:
                 if repr(ti) in cleaned_up_task_instances:
                     self._task_context_logger.warning(
-                        "Marking task instance %s stuck in queued as failed. "
+                        "Marking task instance %s stuck in queued for {} seconds as failed. "

Review Comment:
   It may be worth mentioning why a task stuck in queued (i.e. `task_queued_timeout`) and possibly even linking to the config docs for `task_queued_timeout`



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


Re: [PR] Add messages to task log about moving to queued [airflow]

Posted by "collinmcnulty (via GitHub)" <gi...@apache.org>.
collinmcnulty commented on PR #37951:
URL: https://github.com/apache/airflow/pull/37951#issuecomment-2080031779

   I didn't progress further on this because of concern that the task context calls in the critical section would slow down scheduler performance


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