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


##########
task-sdk/src/airflow/sdk/coordinators/_subprocess.py:
##########
@@ -604,6 +658,220 @@ 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:
+            self._stop_xcom_backend()
+
+    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 not None and not 
self._xcom_backend.can_run_a_call:
+            # The process has exited, so a call sent to it would wait for an 
answer that never comes.
+            self._stop_xcom_backend()

Review Comment:
   Only stdin is closed at this point, so the other sockets keep the loop 
going, and runtime requests get dispatched re-entrantly. A concurrent `GetXCom` 
handled in there starts a new helper, but The first helper is never stopped.
   
   The process is already known to be dead here. I think we can reap it without 
servicing the shared selector 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]

Reply via email to