rjtshrm commented on issue #52501:
URL: https://github.com/apache/airflow/issues/52501#issuecomment-3088946981

   Hi @gopidesupavan, we are using kubernetes executor. Here is my test dag:
   
   ```
   import datetime
   import logging
   from airflow.providers.cncf.kubernetes.operators.pod import 
KubernetesPodOperator
   from airflow.decorators import task
   from airflow.sdk import DAG
   
   LOGGER = logging.getLogger(__name__)
   
   with DAG(
       dag_id="test_dag_3_x",
       schedule=None,
       start_date=datetime.datetime(2025, 1, 1),
   ):
   
   
   
       quay_k8s = KubernetesPodOperator(
           namespace="airflow",
           image="bash:latest",
           cmds=["bash", "-c"],
           arguments=[
               "sleep 10; echo 'Hello world'; sleep 50"
           ],
           task_id="test_pod_1",
       )
   ```
   
   Also from your statement:
   
   > we have some issue with cloudwatch log 
https://github.com/apache/airflow/issues/50802 and fix we have provided here 
https://github.com/apache/airflow/pull/51022 it worked i dont see any issue in 
that.
   
   It handle upload operation and check if handler is not in shutting_down 
state. If not then flush the logs.
   
   My concern is that why **shutting_down** is True even before actual 
execution the task. And, if you see the stack trace in previous attached logs 
(Line 8 - Line 18), the watchtower.CloudWatchLogHandler `close` method is being 
called which sets **shutting_down = true** (can be seen here: 
https://github.com/kislyuk/watchtower/blob/765ca87a043247bbe08e8bfb2cb69d71305bd367/watchtower/__init__.py#L520).
 You could see the trace, and it starts from configure_logging in 
execute_workload.py. 
   
   And, then tasks starts but upload fails because of the 
`self.handler.shutting_down` to True : 
https://github.com/apache/airflow/blob/0702a267579fd70656901e1a9dcda27a2a1f9bbe/providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py#L155-L159
   
   I hope you understand the issue that I want to bring. BTW, I am also using 
apache-airflow-providers-amazon=9.10.0 and airflow=3.0.3.


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