Skip to content

Kubernetes XCOM 10.1.0 regresssion, sidecar isn't being shutdown after job is complete #45452

@kjuulh

Description

@kjuulh

Apache Airflow Provider(s)

cncf-kubernetes

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes==10.1.0

Apache Airflow version

2.10.4

Operating System

alpine

Deployment

Other Docker-based deployment

Deployment details

self hosted kubernetes on AWS

What happened

When the KubernetesPodOperator runs with xcom_push

it ends up stalling in the end because of

Running command... if [ -s /airflow/xcom/return.json ]; then cat /airflow/xcom/return.json; else echo __airflow_xcom_result_empty__; fi
Running command... kill -2 $(pgrep -u $(whoami) -f trap)
stderr from command: whoami: unknown uid 1000
pgrep: unknown user -f

What you think should happen instead

A recent change caused this to change because it looks like the username changed, (now root). And we don't want to shut down all processed only the sleep that is causing the sidecar to wait. However, the new setup doesn't pick up those processed, and just returns an empty result.

How to reproduce

Can be tested manually either with the kubernetespodoperator, or via. debian/ubuntu by itself

 docker run -it alpine sh
 sh -c trap "exit 0" INT; while true; do sleep 1; done;
 
 # in another terminal or docker desktop
 $(pgrep -u $(whoami) -f trap)
 # it returns nothing because of -f trap. If it is removed we get three process ids and it works

Anything else

All the time.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions