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


##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -728,23 +728,24 @@ def extract_xcom_kill(self, pod: V1Pod):
             self._exec_pod_command(resp, "kill -s SIGINT 1")
 
     def _exec_pod_command(self, resp, command: str) -> str | None:
-        res = None
-        if resp.is_open():
-            self.log.info("Running command... %s\n", command)
-            resp.write_stdin(command + "\n")
-            while resp.is_open():
-                resp.update(timeout=1)
-                while resp.peek_stdout():
-                    res = res + resp.read_stdout() if res else 
resp.read_stdout()
-                error_res = None
-                while resp.peek_stderr():
-                    error_res = error_res + resp.read_stderr() if error_res 
else resp.read_stderr()
-                if error_res:
-                    self.log.info("stderr from command: %s", error_res)
-                    break
-                if res:
-                    return res
-        return res
+        res = ""
+        if not resp.is_open():
+            return None
+        self.log.info("Running command... %s", command)
+        resp.write_stdin(command + "\n")

Review Comment:
   ```suggestion
           resp.write_stdin(f"{command}\n")
   ```
   
   or
   
   ```suggestion
           resp.write_stdin(command)
           resp.write_stdin("\n")
   ```



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