Skip to content

Incorrect await_container_completion in KubernetesPodOperator #26796

Description

@windmark

Apache Airflow version

2.3.4

What happened

The await_container_completion function has a negated condition

while not self.container_is_running(pod=pod, container_name=container_name):

that causes our Airflow tasks running <1 s to never be completed, causing an infinite loop.

I see this was addressed and released in #23883, but later reverted in #24474. How come it was reverted? The thread on that revert PR with comments from @jedcunningham and @potiuk didn't really address why the fix was reverted.

What you think should happen instead

Pods finishing within 1s should be properly handled.

How to reproduce

No response

Operating System

Linux

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes==4.3.0

Deployment

Other 3rd-party Helm chart

Deployment details

No response

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions