You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/12 09:42:10 UTC

[GitHub] [airflow] MaksYermak opened a new pull request, #24993: Fix xcom_sidecar stuck problem

MaksYermak opened a new pull request, #24993:
URL: https://github.com/apache/airflow/pull/24993

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   This PR fixes the problem which is described here https://github.com/apache/airflow/issues/22318
   
   Co-authored-by: Wojciech Januszek [januszek@google.com](mailto:januszek@google.com)
   Co-authored-by: Lukasz Wyszomirski [wyszomirski@google.com](mailto:wyszomirski@google.com)
   Co-authored-by: Maksim Yermakou [maksimy@google.com](mailto:maksimy@google.com)
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #24993: Fix xcom_sidecar stuck problem

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #24993:
URL: https://github.com/apache/airflow/pull/24993#discussion_r918789639


##########
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py:
##########
@@ -404,8 +404,12 @@ def await_pod_start(self, pod: k8s.V1Pod):
     def extract_xcom(self, pod: k8s.V1Pod):
         """Retrieves xcom value and kills xcom sidecar container"""
         result = self.pod_manager.extract_xcom(pod)
-        self.log.info("xcom result: \n%s", result)
-        return json.loads(result)
+        if isinstance(result, str) and result.replace('\n', '') == 'False':

Review Comment:
   ```suggestion
           if isinstance(result, str) and result.rstrip() == 'False':
   ```
   
   It may also be worthwile to use a more obscure string (say `__airflow_xcom_result_empty__`?) to make the intent easier to identify.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk merged pull request #24993: Fix xcom_sidecar stuck problem

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #24993:
URL: https://github.com/apache/airflow/pull/24993


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] kaxil commented on a diff in pull request #24993: Fix xcom_sidecar stuck problem

Posted by GitBox <gi...@apache.org>.
kaxil commented on code in PR #24993:
URL: https://github.com/apache/airflow/pull/24993#discussion_r918819014


##########
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py:
##########
@@ -404,8 +404,12 @@ def await_pod_start(self, pod: k8s.V1Pod):
     def extract_xcom(self, pod: k8s.V1Pod):
         """Retrieves xcom value and kills xcom sidecar container"""
         result = self.pod_manager.extract_xcom(pod)
-        self.log.info("xcom result: \n%s", result)
-        return json.loads(result)
+        if isinstance(result, str) and result.replace('\n', '') == 'False':

Review Comment:
   +1 to using rstrip



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] MaksYermak commented on pull request #24993: Fix xcom_sidecar stuck problem

Posted by GitBox <gi...@apache.org>.
MaksYermak commented on PR #24993:
URL: https://github.com/apache/airflow/pull/24993#issuecomment-1185467710

   > Agree with @uranusjr "else echo False; fi" is a bad idea, because "False" is quite likely return value from a Pod. Please change it to some more "unique" sentinel.
   
   @potiuk I have updated the string name


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] MaksYermak commented on a diff in pull request #24993: Fix xcom_sidecar stuck problem

Posted by GitBox <gi...@apache.org>.
MaksYermak commented on code in PR #24993:
URL: https://github.com/apache/airflow/pull/24993#discussion_r920076974


##########
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py:
##########
@@ -404,8 +404,12 @@ def await_pod_start(self, pod: k8s.V1Pod):
     def extract_xcom(self, pod: k8s.V1Pod):
         """Retrieves xcom value and kills xcom sidecar container"""
         result = self.pod_manager.extract_xcom(pod)
-        self.log.info("xcom result: \n%s", result)
-        return json.loads(result)
+        if isinstance(result, str) and result.replace('\n', '') == 'False':

Review Comment:
   @uranusjr @kaxil I have changed replace() to rstrip()



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org