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


##########
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)
+            return result
         if decision.action == "already_succeeded":
+            self._record_try(context, DurableDecision.ALREADY_SUCCEEDED, 
decision.external_id)
             return self.get_job_result(decision.external_id, context)
 
+        # A "submit" decision covers both a first submit and one after a 
failed job; only the
+        # latter still has an id stored, which the banner shows as the job 
that was replaced.
+        task_state_store = context.get("task_state_store")
+        failed_id = task_state_store.get(self.external_id_key) if 
task_state_store is not None else None

Review Comment:
   `get_resume_decision` now returns the failed ID on the terminal `submit`, 
and `execute_resumable` uses it instead of reading the store again. Reworded 
the comment: the replaced ID stays in the record, the banner does not show 
resubmits.



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