Wait for Job pods before failing KubernetesJobOperator discovery - #70636
Open
cipheraxat wants to merge 2 commits into
Open
Wait for Job pods before failing KubernetesJobOperator discovery#70636cipheraxat wants to merge 2 commits into
cipheraxat wants to merge 2 commits into
Conversation
cipheraxat
requested review from
hussein-awala,
jedcunningham and
jscheffl
as code owners
July 28, 2026 18:25
mo-rieger
reviewed
Jul 29, 2026
Comment on lines
+157
to
+160
| # Kept for backward compatibility with code that reads the attribute. | ||
| self.discover_pods_retry_number = ( | ||
| discover_pods_retry_number if discover_pods_retry_number is not None else 3 | ||
| ) |
Contributor
There was a problem hiding this comment.
AFAICS there is no code that reads discover_pods_retry_number when this fix is applied.
Author
There was a problem hiding this comment.
Removed the unused self.discover_pods_retry_number assignment. The kwarg is still accepted and emits the deprecation warning; the test now only asserts that warning. Also rebased onto latest main.
The Job controller can take longer than a few immediate list calls to create pods. Failing immediately marked tasks failed while the Job still succeeded, and retries risked starting a second Job.
The parameter remains accepted with a deprecation warning, but nothing reads the attribute after discovery switched to schedule_timeout polling.
cipheraxat
force-pushed
the
fix/70585-k8s-job-wait-for-pods
branch
from
July 29, 2026 08:32
9c82952 to
3b2dc06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KubernetesJobOperator.get_pods()used to hammerlist_namespaced_poda few times with no delay, then fail if the Job controller had not created pods yet. In practice that race marks the task failed while the Job still runs to success, and a retry can start a second Job.This change waits up to
schedule_timeout_seconds, polling everystartup_check_interval_seconds(both already inherited fromKubernetesPodOperator). The first probe stays immediate. Discovery also stops oncelen(pods) >= parallelism, anddiscover_pods_retry_numberis deprecated as a no-op.closes: #70585
Was generative AI tooling used to co-author this PR?
Generated-by: Cursor Grok 4.5 following the guidelines