lanms opened a new issue #19069:
URL: https://github.com/apache/airflow/issues/19069


   ### Apache Airflow version
   
   2.2.0 (latest released)
   
   ### Operating System
   
   centos
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   I use two case run pythonoperator
   A memory leak occurs when pythonOperator is used. The machine runs out of 
memory and the task is forced to end,
   task is running, cannot turn to success status, but code python_callable is 
execute end
   
   here is a example
   test1 cannot change status to success , test2 canot auto change to success
   
   
   from datetime import datetime
   from airflow import DAG
   from airflow.operators.python import PythonOperator, ShortCircuitOperator
   from airflow.utils.dates import days_ago
   
   
   def test1():
       from bigshared.common.enterprise_weichat import EnterpriseWeiChat
   
       today_str = datetime.now().strftime("%Y-%m-%d")
       
       run = True
   
       ew = EnterpriseWeiChat(api_key='xxxxxxxxxxxxxx')
       if run:
           ew.send(title="调试", text="{}, 开始".format(today_str), color="black")
           return True
       else:
           ew.send(title="调试2222", text="{} 跳过".format(today_str), 
color="warning")
           return False
   
   
   def test2():
       print('1111111111111111')
   
   
   with DAG(
       dag_id='test',
       default_args={
       'owner': 'airflow',
   },
       schedule_interval=None,
       start_date=days_ago(2),
       tags=['test'],
   ) as dag:
       test1 = ShortCircuitOperator(task_id='test1', python_callable=test1)
       test2 = PythonOperator(task_id='test2', python_callable=test2)
   
   
   ### What you expected to happen
   
   The task is complete and mark success
   
   ### How to reproduce
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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