ashb commented on code in PR #48239:
URL: https://github.com/apache/airflow/pull/48239#discussion_r2016318713
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -594,8 +657,27 @@ def __init__(self):
self.failed_triggers = deque()
self.job_id = None
+ def init_comms(self):
+ """Init supervisor comms."""
+ from airflow.sdk.execution_time import task_runner
+
+ comms_decoder = task_runner.CommsDecoder[ToTriggerRunner,
ToTriggerSupervisor](
+ input=sys.stdin,
+ decoder=TypeAdapter[ToTriggerRunner](ToTriggerRunner),
+ )
+
+ msg = comms_decoder.get_message()
+ if not isinstance(msg, messages.StartTriggerer):
+ raise RuntimeError(f"Required first message to be a
messages.StartTriggerer, it was {msg}")
+ comms_decoder.request_socket = os.fdopen(msg.requests_fd, "wb",
buffering=0)
+
+ task_runner.SUPERVISOR_COMMS = comms_decoder
+
def run(self):
"""Sync entrypoint - just run a run in an async loop."""
+ # Make sure comms are initialized before running
Review Comment:
```suggestion
# Make sure comms are initialized before allowing any Triggers to run
```
--
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]