punx120 opened a new issue, #56372:
URL: https://github.com/apache/airflow/issues/56372

   ### Apache Airflow version
   
   3.1.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Hi,
   
   This is related to #56366, I would like to do some clean up in 
`BaseTrigger.cleanup`, the doc says that the cleanup method is run in the 
triggerer main event loop, but I don't think that's always the case, e.g when I 
mark a task as failed, I believe it gets cancelled via `future.cancel` 
(triggerer_job_runner.py:976), which triggers a `asyncio.CancelledError`, when 
i log `ayncio.current_task()` in my `cleanup` method, it shows it still the 
coroutine of the trigger which has just been cancelled which means it's not run 
in the main triggerer event loop unless i'm missing something?
   
   Thanks
   Sylvain
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Run a trigger, mark the task as failed
   
   ### Operating System
   
   linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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