o-nikolas commented on code in PR #23490:
URL: https://github.com/apache/airflow/pull/23490#discussion_r867059383


##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -368,20 +368,25 @@ def extract_xcom(self, pod: V1Pod) -> str:
                 _preload_content=False,
             )
         ) as resp:
-            result = self._exec_pod_command(resp, f'cat 
{PodDefaults.XCOM_MOUNT_PATH}/return.json')
+            result = self._exec_pod_command(resp, f'cat 
{PodDefaults.XCOM_MOUNT_PATH}/return.json', True)
             self._exec_pod_command(resp, 'kill -s SIGINT 1')
         if result is None:
             raise AirflowException(f'Failed to extract xcom from pod: 
{pod.metadata.name}')
         return result
 
-    def _exec_pod_command(self, resp, command: str) -> Optional[str]:
+    def _exec_pod_command(self, resp, command: str, 
extract_full_content=False) -> Optional[str]:
         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)
+                res = None
                 if resp.peek_stdout():
-                    return resp.read_stdout()
+                    res = resp.read_stdout()
+                    if extract_full_content:

Review Comment:
   I suppose we'd have to know what the original intention of this code was. 
But IMHO I don't think returning a partial response is a feature, it is a bug :)



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