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

   ### Apache Airflow version
   
   2.10.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I have a new provider to send jobs to a Ray cluster. One of the operators 
has pre_execute and post_execute operations. Here is the complete flow of 
control
   
   1. pre_execute() --> Sets up a Ray cluster
   2. execute() --> Triggers a new job on the cluster and defers tracking to a 
trigger
   3. async trigger --> tracks the job execution and prints logs
   4. execute_complete() --> completes main task execution after the trigger 
reaches terminal state
   5. post_execute() --> Deletes the Ray cluster
   
   When post_execute() starting executing it seems to be running pre_execute() 
code again. This is a bug. We should only see post_execute code. Logs attached.
   
   
   
[post_execute_bug.txt](https://github.com/user-attachments/files/16734203/post_execute_bug.txt)
   
   ### What you think should happen instead?
   
   Only code relevant to the post_execute method must execute.
   
   ### How to reproduce
   
   1. Install the provider using the instructions mentioned on 
[this](https://astronomer.github.io/astro-provider-ray/getting_started/setup.html)
 github page
   2. Run one of the example DAGs that only uses the SubmitRayJob operator in 
the DAG
   
   You will need access to a k8 cluster and will need to provide connection 
details as shown in step 1
   
   
   ### Operating System
   
   linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _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