pierrejeambrun commented on code in PR #29516:
URL: https://github.com/apache/airflow/pull/29516#discussion_r1109204792
##########
airflow/jobs/base_job.py:
##########
@@ -245,32 +246,47 @@ def heartbeat(self, only_if_necessary: bool = False):
# We didn't manage to heartbeat, so make sure that the timestamp
isn't updated
self.latest_heartbeat = previous_heartbeat
+ @staticmethod
+ @internal_api_call
+ @provide_session
+ def pre_execute(job: BaseJob, *, session: Session = NEW_SESSION) -> None:
+ """Update the database job entry before running the _execute()
function."""
+ job.state = State.RUNNING
+ session.add(job)
+ session.commit()
+ make_transient(job)
Review Comment:
Yep, much bigger problem :joy:.
Putting this one in draft as I will not be able to update before going on
holidays.
--
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]