Skip to content

Conversation

@AutomationDev85
Copy link
Contributor

Overview

During working with the KubernetesPodOperator we found the issue that sometimes the POD was already in terminated state and then KubernetesPodOperator tries to reconnect to this pod. But if the xcom sidecar is not running any more it makes no sense to work with this pod. Idea is to check if the pod is terminated then then delete the POD and create a new POD to run the task.

Details of change:

  • Function get_or_create_pod checks if found pod is terminated. Then create new POD to run the task and delete the old pod.

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels May 28, 2025
Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. LGTM for the change, but the k8s test still need to be fixed.

@AutomationDev85 AutomationDev85 force-pushed the feature/kubernetespodoperator-detect-terminated-pod-during-reconnect branch 3 times, most recently from a82d025 to 8b2cbeb Compare June 5, 2025 12:00
@AutomationDev85 AutomationDev85 force-pushed the feature/kubernetespodoperator-detect-terminated-pod-during-reconnect branch from 8b2cbeb to 6c011de Compare June 6, 2025 06:39
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me... let's have CI green and then LGTM!

@jscheffl jscheffl merged commit 73b9a77 into apache:main Jun 6, 2025
78 checks passed
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
)

Co-authored-by: AutomationDev85 <AutomationDev85>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants