67643 fix queued task issue in k8s operator - #67896
Conversation
|
Also validated with correct configs and the dag is succeeding as expected:
|
|
I looked at the code and first-hand looks reasonable but (1) I am not sure about side effects putting a task to "running" list even if it just entered the queue - fear there are side-effects - and (2) am not sure about the added As not being expert in K8sExecutor and not using it would request some other reviewer with expertise on this: @jedcunningham can you take a look or do you know an expert if the fix is OK like this? |
So regarding (2), from what I see during my testing, a With the I am happy to understand any possible issues with (1) and test it out or try out an alternative approach. |
…/github.com/kunaljubce/airflow into 67643-fix-queued-task-issue-in-k8s-operator
…/github.com/kunaljubce/airflow into 67643-fix-queued-task-issue-in-k8s-operator
|
@potiuk With ref. to your automation comments, I have resolved the review comments after pushing in the fixes. Do I need to do anything for the assignment? |
|
@kunaljubce Could you please resolve conflicts, as well as rename the PR's title so it would be clear what it does? |
I see there are some changes done to |
|
@kunaljubce This PR has been converted to draft because it does not yet meet our Pull Request quality criteria. Issues found:
What to do next:
Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. |


executor_configdict format #67643So when I look into the scheduler logs after the task gets hung up in "queued state", I see the below:
However the task keeps being run within the scheduler as evident from the below logs:
Flow of function call:
KubernetesExecutor._process_workloads()->KubernetesExecutor.execute_async()->PodGenerator.from_objSo what's happening -
PodGenerator.from_objcallable receives deprecated config object and a TypeError is raised -executor_config: {'pod_override': 'something something', 'KubernetesExecutor': {'config_file': '/some/path/kubeconfig.yaml'}}KubernetesExecutor.execute_async()->self.fail()is triggered ->change_stateremoves thekeyfromself.runningand exits the function call.KubernetesExecutor._process_workloads(), wherein, on the very next line,self.running.add(key)is executed unconditionally — regardless of whetherexecute_asyncsucceeded or failed.keyis inself.running— the event buffer already has theFAILEDevent, but when the scheduler processes it,executor.has_task(ti)returnsTrue(because thekeyis inself.running), so the failure is ignored.Fix:
self.running.add(key)to the success path insideKubernetesExecutor.execute_async()so that thekeyonly gets added to the task queue event buffer if configurations were as per expectation.Was generative AI tooling used to co-author this PR?
Generated-by: Myself, Tested-by: Myself, Assisted-by: Claude Code
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.Important
🛠️ Maintainer triage note for @kunaljubce · by
@potiuk· 2026-07-28 17:13 UTCThis draft PR has been inactive since the last triage note, with no response from the author. Closing to keep the queue clean:
mainbranch first.The ball is in your court — you've been assigned to this PR. Reopen or open a fresh PR once addressed — no rush.
See the Pull Request quality criteria for how to fix each item. There is no rush.
Automated triage — may be imperfect; a maintainer takes the next look. We use this two-stage triage process so maintainers' limited time goes to the conversation with you.