ashb commented on code in PR #51780: URL: https://github.com/apache/airflow/pull/51780#discussion_r2154369426
########## task-sdk/src/airflow/sdk/execution_time/task_runner.py: ########## @@ -642,22 +643,29 @@ def parse(what: StartupDetails, log: Logger) -> RuntimeTaskInstance: # accessible wherever needed during task execution without modifying every layer of the call stack. SUPERVISOR_COMMS: CommsDecoder[ToTask, ToSupervisor] + # State machine! # 1. Start up (receive details from supervisor) # 2. Execution (run task code, possibly send requests) # 3. Shutdown and report status def startup() -> tuple[RuntimeTaskInstance, Context, Logger]: - # The parent sends us a StartupDetails message un-prompted. After this, every single message is only sent + # The parent sends us a StartupDetails message un-prompted. After this, ever single message is only sent # in response to us sending a request. - msg = SUPERVISOR_COMMS._get_response() + log = structlog.get_logger(logger_name="task") + + if os.environ.get("_AIRFLOW__REEXECUTED_PROCESS") == "1" and os.environ.get("_AIRFLOW__STARTUP_MSG"): + # entrypoint of re-exec process + msg = TypeAdapter(StartupDetails).validate_json(os.environ["_AIRFLOW__STARTUP_MSG"]) + log.info("Using serialized startup message from environment", msg=msg) Review Comment: ```suggestion log.debug("Using serialized startup message from environment", msg=msg) ``` -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org