pankajkoti commented on code in PR #35857:
URL: https://github.com/apache/airflow/pull/35857#discussion_r1405349816


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1577,15 +1577,18 @@ def _fail_tasks_stuck_in_queued(self, session: Session 
= NEW_SESSION) -> None:
             )
         ).all()
         try:
-            tis_for_warning_message = 
self.job.executor.cleanup_stuck_queued_tasks(tis=tasks_stuck_in_queued)
-            if tis_for_warning_message:
-                task_instance_str = "\n\t".join(tis_for_warning_message)
-                self.log.warning(
-                    "Marked the following %s task instances stuck in queued as 
failed. "
-                    "If the task instance has available retries, it will be 
retried.\n\t%s",
-                    len(tasks_stuck_in_queued),
-                    task_instance_str,
-                )
+            cleaned_up_task_instances = 
self.job.executor.cleanup_stuck_queued_tasks(
+                tis=tasks_stuck_in_queued
+            )
+            cleaned_up_task_instances = set(cleaned_up_task_instances)
+            for ti in tasks_stuck_in_queued:
+                if repr(ti) in cleaned_up_task_instances:
+                    self._task_context_logger.error(
+                        "Marking task instance %s stuck in queued as failed. "
+                        "If the task instance has available retries, it will 
be retried.",
+                        ti,
+                        ti=ti,

Review Comment:
   We won't loose this information. Even if the user disables the feature the 
TCL would log this information using this site's logger in the scheduler itself 
https://github.com/apache/airflow/pull/32646/files#diff-fb48bd1344270ccbaadb60b2b7fbc5d74bb5440f908eedd384bd25ada648c05dR91
   
   Yes, we can test the performance. If it hits the performance badly, we can 
disable the feature and still have logs as mentioned above.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to