-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
Apache Airflow version: 1.10.9
Kubernetes version (if you are using kubernetes) (use kubectl version): 1.14.9
Environment:
- Cloud provider or hardware configuration: AWS EKS
- OS (e.g. from /etc/os-release): Linux (debian 9.12 inside docker image)
- Kernel (e.g.
uname -a): 5.4.0 (on my host) - Install tools:
- Others:
What happened:
I ran a new task using the KubernetesPodOperator on our k8s cluster. This pod is designed to write to the /airflow/xcom/return.json even in case of failures so we can send a user-friendly error message in a following task. The pod exits with a non-zero exit code, so Airflow appropriately updates the task as failed, but the XCOM values are not available.
What you expected to happen:
I expected XCOM variables to be available even on pod failure. We use this capability in other operators to signal error conditions and messages.
How to reproduce it:
Run a KubernetesPodOperator with a command like this in an alpine image.
/bin/bash -c 'echo "{'success': False}" > /airflow/xcom/return.json; exit 1'
Check the XCOM results, which should include the JSON dictionary.
Anything else we need to know: