wjddn279 commented on code in PR #63498:
URL: https://github.com/apache/airflow/pull/63498#discussion_r3145200112
##########
providers/edge3/src/airflow/providers/edge3/cli/worker.py:
##########
@@ -260,40 +260,51 @@ def _get_state(self) -> EdgeWorkerState:
return EdgeWorkerState.MAINTENANCE_MODE
return EdgeWorkerState.IDLE
- def _run_job_via_supervisor(self, workload: ExecuteTask, results_queue:
Queue) -> int:
+ def _run_job_via_supervisor(self, workload: ExecuteTypeBody,
results_queue: Queue) -> int:
_reset_parent_signal_state()
- from airflow.sdk.execution_time.supervisor import supervise
-
# Ignore ctrl-c in this process -- we don't want to kill _this_ one.
we let tasks run to completion
+
os.setpgrp()
logger.info("Worker starting up pid=%d", os.getpid())
- ti = workload.ti
- setproctitle(
- "airflow edge supervisor: "
- f"dag_id={ti.dag_id} task_id={ti.task_id} run_id={ti.run_id}
map_index={ti.map_index} "
- f"try_number={ti.try_number}"
- )
try:
- supervise(
- # This is the "wrong" ti type, but it duck types the same.
TODO: Create a protocol for this.
- # Same like in
airflow/executors/local_executor.py:_execute_workload()
- ti=ti, # type: ignore[arg-type]
- dag_rel_path=workload.dag_rel_path,
- bundle_info=workload.bundle_info,
- token=workload.token,
- server=self._execution_api_server_url,
- log_path=workload.log_path,
- )
+ if AIRFLOW_V_3_3_PLUS:
+ proctitle = f"airflow edge supervisor executing callback:
{workload.ti.task_id} "
Review Comment:
oh, thanks!
--
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]