This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new faae9faae3 Fixed Kubernetes Operator large xcom content Defect
(#23490)
faae9faae3 is described below
commit faae9faae396610086d5ea18d61c356a78a3d365
Author: rahulgoyal2987 <[email protected]>
AuthorDate: Tue May 10 21:16:55 2022 +0530
Fixed Kubernetes Operator large xcom content Defect (#23490)
---
airflow/providers/cncf/kubernetes/utils/pod_manager.py | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/airflow/providers/cncf/kubernetes/utils/pod_manager.py
b/airflow/providers/cncf/kubernetes/utils/pod_manager.py
index 993ba12e31..46e593a2c9 100644
--- a/airflow/providers/cncf/kubernetes/utils/pod_manager.py
+++ b/airflow/providers/cncf/kubernetes/utils/pod_manager.py
@@ -375,14 +375,20 @@ class PodManager(LoggingMixin):
return result
def _exec_pod_command(self, resp, command: str) -> Optional[str]:
+ 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)
- if resp.peek_stdout():
- return resp.read_stdout()
- if resp.peek_stderr():
- self.log.info("stderr from command: %s",
resp.read_stderr())
+ 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
- return None
+ if res:
+ return res
+ return res