amoghrajesh commented on code in PR #76833:
URL: https://github.com/apache/airflow/pull/76833#discussion_r4658753555
##########
task-sdk/src/airflow/sdk/bases/resumablejobmixin.py:
##########
@@ -225,6 +263,74 @@ def persist_job_id(self, context: Context, external_id:
JsonValue) -> None:
external_id=external_id,
)
+ def _record_reconnect_outcome(self, context: Context, external_id:
JsonValue) -> None:
+ """Record the reconnected job's status once polling returns, which may
be before the job ends."""
+ try:
+ job_status = self.get_job_status(external_id, context)
+ except Exception:
+ self.log.warning("Could not read job status for durable execution
history", exc_info=True)
+ return
+ if self.is_job_succeeded(job_status):
+ self._record_try(context, DurableDecision.RECONNECTED,
external_id, status="success")
+ elif not self.is_job_active(job_status):
Review Comment:
A poll that returns without raising now records `success` once the job is no
longer active, and `running` if it returned early. Real failures raise, and
that path records `failed` only when the job is terminal and did not succeed.
--
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]