-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix xcom_sidecar stuck problem #24993
Conversation
@@ -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': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(result, str) and result.replace('\n', '') == 'False': | |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to using rstrip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
This PR fixes the problem which is described here #22318
closes: #22318
Co-authored-by: Wojciech Januszek januszek@google.com
Co-authored-by: Lukasz Wyszomirski wyszomirski@google.com
Co-authored-by: Maksim Yermakou maksimy@google.com
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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.