Skip to content

Fix K8s executor to use JoinableQueue matching its usage contract#63789

Merged
jscheffl merged 1 commit intoapache:mainfrom
Dev-iL:2603/fix-k8s-joinable-queue
Mar 17, 2026
Merged

Fix K8s executor to use JoinableQueue matching its usage contract#63789
jscheffl merged 1 commit intoapache:mainfrom
Dev-iL:2603/fix-k8s-joinable-queue

Conversation

@Dev-iL
Copy link
Collaborator

@Dev-iL Dev-iL commented Mar 17, 2026

Summary

  • Change self._manager.Queue() to self._manager.JoinableQueue() for both task_queue and result_queue in the Kubernetes executor.

Details

The Kubernetes executor calls task_done(), join(), and uses flush logic that assumes task accounting is tracked — all of which require the JoinableQueue contract. Using a plain Queue() doesn't support these operations. This mismatch was previously silent but manifests as ValueError: task_done() called too many times in teardown/error paths on Python 3.14 where queue behavior is stricter.

related: #63520


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 4.6 following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Mar 17, 2026
@Dev-iL Dev-iL force-pushed the 2603/fix-k8s-joinable-queue branch from 54436de to 01ba310 Compare March 17, 2026 08:52
The executor already treats both queues as joinable queues. It calls:
  - task_done()
  - join()
  - flush logic that assumes task accounting is tracked

A plain manager Queue() does not match that contract. On Python 3.14 this showed up in teardown/error paths as: `ValueError: task_done() called too many times`
@Dev-iL Dev-iL force-pushed the 2603/fix-k8s-joinable-queue branch from 01ba310 to 3f9c24a Compare March 17, 2026 10:13
@Dev-iL Dev-iL mentioned this pull request Mar 17, 2026
6 tasks
@jscheffl jscheffl merged commit 434c1cc into apache:main Mar 17, 2026
110 checks passed
@Dev-iL Dev-iL deleted the 2603/fix-k8s-joinable-queue branch March 17, 2026 19:55
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Mar 18, 2026
The executor already treats both queues as joinable queues. It calls:
  - task_done()
  - join()
  - flush logic that assumes task accounting is tracked

A plain manager Queue() does not match that contract. On Python 3.14 this showed up in teardown/error paths as: `ValueError: task_done() called too many times`
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Mar 18, 2026
The executor already treats both queues as joinable queues. It calls:
  - task_done()
  - join()
  - flush logic that assumes task accounting is tracked

A plain manager Queue() does not match that contract. On Python 3.14 this showed up in teardown/error paths as: `ValueError: task_done() called too many times`
fat-catTW pushed a commit to fat-catTW/airflow that referenced this pull request Mar 22, 2026
The executor already treats both queues as joinable queues. It calls:
  - task_done()
  - join()
  - flush logic that assumes task accounting is tracked

A plain manager Queue() does not match that contract. On Python 3.14 this showed up in teardown/error paths as: `ValueError: task_done() called too many times`
techcodie pushed a commit to techcodie/airflow that referenced this pull request Mar 23, 2026
The executor already treats both queues as joinable queues. It calls:
  - task_done()
  - join()
  - flush logic that assumes task accounting is tracked

A plain manager Queue() does not match that contract. On Python 3.14 this showed up in teardown/error paths as: `ValueError: task_done() called too many times`
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.

2 participants