Skip to content

KubernetesPodOperator xcom push failure #29002

@j-svensmark

Description

@j-svensmark

Apache Airflow version

2.5.0

What happened

Kubernetes pod operator failed to push xcom value.

After upgrading airflow from 2.2.4 to 2.5.0 (and apache-airflow-providers-cncf-kubernetes from 3.0.2 to 5.0.0) pushing of xcom values from kubernetes pod operator stopped working.

What you think should happen instead

Example of log before the upgrade

[2023-01-17 06:57:54,357] {pod_launcher.py:313} INFO - Running command... cat /airflow/xcom/return.json

[2023-01-17 06:57:54,398] {pod_launcher.py:313} INFO - Running command... kill -s SIGINT 1

[2023-01-17 06:57:55,012] {pod_launcher.py:186} INFO - ["No non-accuracy metrics changed more than 10.0% between 2023-01-15 and 2023-01-16\n"]

and after the upgrade

[2023-01-18T07:12:32.784+0900] {pod_manager.py:368} INFO - Checking if xcom sidecar container is started.
[2023-01-18T07:12:32.804+0900] {pod_manager.py:372} INFO - The xcom sidecar container is started.
[2023-01-18T07:12:32.845+0900] {pod_manager.py:407} INFO - Running command... if [ -s /airflow/xcom/return.json ]; then cat /airflow/xcom/return.json; else echo __airflow_xcom_result_empty__; fi

[2023-01-18T07:12:32.895+0900] {pod_manager.py:407} INFO - Running command... kill -s SIGINT 1

[2023-01-18T07:12:33.405+0900] {kubernetes_pod.py:431} INFO - Result file is empty.

Looking at other timestamps in the log file, it appears that the xcom sidecar is run before the pod finishes, instead of waiting until the end.

How to reproduce

I used airflow.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperator with get_logs=False.

Operating System

Debian GNU/Linux 11 (bullseye) (based on official airflow image)

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes 3.0.2 and 5.0.0

Deployment

Official Apache Airflow Helm Chart

Deployment details

Deployed on GKE using the official helm chart

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions