Skip to content

KubernetesPodOperator do_xcom_push=True and deferrable=True does not push return_value to xcom #58796

Closed

Description

@yovio-rca

Apache Airflow Provider(s)

cncf-kubernetes

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes==10.10.0

Apache Airflow version

2.11.0

Operating System

Debian 12

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

What happened

We use do_xcom_push = True on KubernetesPodOperator like below, we also set deferrable=True

write_xcom = KubernetesPodOperator(
namespace="default",
image="{{ macros.rca_plugins.ecr_repo() }}/roscommon/rcapvt:{{ var.value.rcapvt_image_tag }}",
cmds=["sh", "-c", "mkdir -p /airflow/xcom/;echo '[5,6,7,8]' > /airflow/xcom/return.json"],
name="write-xcom",
do_xcom_push=True,
deferrable=True,
on_finish_action="delete_pod",
in_cluster=True,
task_id="write-xcom",
get_logs=True,
)

On apache-airflow-providers-cncf-kubernetes==10.9.0, this all working fine, I can see return_value in xcom

But once I upgrade to version 10.10.0, this do_xcom_push functionality no longer works, I cannot see return_value in xcom.

It works in 10.10.0 in non deferrable mode, in 10.9.0 deferable or non-deferable works fine.

What you think should happen instead

do_xcom_push should work either in deferrable or non-deferrable, return_value should get populated in xcom

How to reproduce

Create a dag with below task:

write_xcom = KubernetesPodOperator(
namespace="default",
image="alpine",
cmds=["sh", "-c", "mkdir -p /airflow/xcom/;echo '[1,2,3,4]' > /airflow/xcom/return.json"],
name="write-xcom",
do_xcom_push=True,
deferrable=True,
on_finish_action="delete_pod",
in_cluster=True,
task_id="write-xcom",
get_logs=True,
)

Run it and you will not see see return_value in xcom

Anything else

I check PR #57531
on pod.py file
https://github.com/apache/airflow/pull/57531/files#diff-253d1c55d88669a074ae3cbfa0a79a2dfc811277cdb32642a01a9dbaddb82f30

it delete line 946:
return xcom_sidecar_output

I think this is what broke the functionality.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Nov 28, 2025
  2. added
    provider:cncf-kubernetes
    on Nov 28, 2025
  3. aaron-y-chen commented on Jan 5, 2026

    @aaron-y-chen
    Contributor

    It seems to be fixed in version 10.11.0. Have you tried upgrading your Kubernetes provider?

    https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/changelog.html

    PR detail in here: #58488

  4. potiuk commented on Jan 5, 2026

    @potiuk
    Member

    It seems to be fixed in version 10.11.0. Have you tried upgrading your Kubernetes provider?

    Closing then. We can always re-open if @yovio-rca re-tests with latest versions and provides some evidences of it not being fixed.

  5. yovio-rca commented on Jan 6, 2026

    @yovio-rca
    Author

    Tested 10.11.0 and I can confirm that it work again.

  6. potiuk commented on Jan 6, 2026

    @potiuk
    Member

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerskind:bugneeds-triageprovider:cncf-kubernetes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions