uranusjr commented on code in PR #75184:
URL: https://github.com/apache/airflow/pull/75184#discussion_r4397262589


##########
task-sdk/src/airflow/sdk/coordinators/_subprocess.py:
##########
@@ -480,6 +544,222 @@ def _handle_set_task_state_store(
                 )
         return super()._handle_set_task_state_store(msg, log, req_id)
 
+    def _monitor_subprocess(self):
+        try:
+            super()._monitor_subprocess()
+        finally:
+            if self._xcom_backend is not None:
+                self._xcom_backend.stop()
+
+    def _start_xcom_backend_call(
+        self, call: XComBackendCall, finish: Callable[[XComBackendResult], 
None]
+    ) -> None:
+        """Send ``call`` to the XCom backend process, which starts on the 
first call it handles."""
+        if self._xcom_backend is None:
+            self._xcom_backend = XComBackendProcess.start(
+                id=self.id,
+                client=self.client,
+                logger=self.process_log,
+                selector=self.selector,
+                on_result=self._finish_xcom_backend_call,

Review Comment:
   There is a single pending slot, and `XComBackendProcess.send_call` has a 
single queue slot. Some runtimes multiplex requests, and everything gets 
garbled. Calls need to be keyed by request id with a FIFO queue, plus a test 
that sends two overlapping requests.



-- 
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]

Reply via email to