uranusjr commented on code in PR #59604:
URL: https://github.com/apache/airflow/pull/59604#discussion_r2667413212
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1648,7 +1678,17 @@ def main():
SUPERVISOR_COMMS = CommsDecoder[ToTask, ToSupervisor](log=log)
try:
- ti, context, log = startup()
+ try:
+ ti, context, log = startup()
+ except AirflowRescheduleException as reschedule:
+ log.info("Rescheduling task during startup, marking task as
UP_FOR_RESCHEDULE")
+ SUPERVISOR_COMMS.send(
+ msg=RescheduleTask(
+ reschedule_date=reschedule.reschedule_date,
+ end_date=datetime.now(tz=timezone.utc),
+ )
+ )
+ exit(0)
Review Comment:
Use `sys.exit` instead?
--
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]