amoghrajesh commented on code in PR #76833:
URL: https://github.com/apache/airflow/pull/76833#discussion_r4629184404


##########
task-sdk/src/airflow/sdk/bases/resumablejobmixin.py:
##########
@@ -132,12 +146,27 @@ def execute_resumable(self, context: Context) -> Any:
 
         decision = self.get_resume_decision(context)
         if decision.action == "reconnect":
-            return self.poll_until_complete(decision.external_id, context)
+            self._record_try(context, DurableDecision.RECONNECTED, 
decision.external_id)
+            result = self.poll_until_complete(decision.external_id, context)
+            self._record_try(context, DurableDecision.RECONNECTED, 
decision.external_id, job_finished=True)

Review Comment:
   The reconnect poll now records `failed` when it raises. After a normal 
return, the status comes from `get_job_status`: `success` with the saved time 
only when the job succeeded, `running` while it is still active, `failed` 
otherwise. `TaskDeferred` is a `BaseException`, so a poll that defers (PowerBI) 
is not marked failed.
   
   Tested end to end with a simulated 90s job, killing try 1 while the job was 
running so try 2 reconnects:
   
   | Scenario | Try 2 | Recorded status | Before this change |
   |---|---|---|---|
   | Job succeeds | success | `success`, saved 93s | same |
   | Job fails while try 2 polls | failed | `failed` | stuck on `running` |
   | Poll returns without waiting | success | `running`, no saved time | 
`success` with a saved time |
   
   **Job succeeds**
   
   <img width="3000" height="1800" alt="fake_banner_reconnect_try2_done" 
src="https://github.com/user-attachments/assets/c4df4a93-6736-44a0-aec1-283c8a7c1bc8";
 />
   
   
   **Job fails while try 2 polls**
   
   <img width="3000" height="1800" 
alt="fake_banner_job_fails_try2_done_tooltip" 
src="https://github.com/user-attachments/assets/67d14e7f-3fb3-4872-ba94-e4ff2ce840cd";
 />
   
   
   
   **Poll returns without waiting**
   
   <img width="3000" height="1800" alt="fake_banner_no_wait_try2_done" 
src="https://github.com/user-attachments/assets/f8d44b28-31ce-443f-9e8b-5327f03ad04d";
 />
   



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