Skip to content

Add streaming task log support to KubernetesExecutor#69300

Draft
jason810496 wants to merge 3 commits into
apache:mainfrom
jason810496:refactor/logging/kubernetes-executor-streaming-logs
Draft

Add streaming task log support to KubernetesExecutor#69300
jason810496 wants to merge 3 commits into
apache:mainfrom
jason810496:refactor/logging/kubernetes-executor-streaming-logs

Conversation

@jason810496

@jason810496 jason810496 commented Jul 3, 2026

Copy link
Copy Markdown
Member

part of the streaming task log series

Why

KubernetesExecutor.get_task_log materializes the whole pod log in the API server. Implementing the new BaseExecutor.get_streaming_task_log yields lines lazily into the bounded LogStreamAccumulator: ~11.6x lower peak heap growth (+2093.9 MiB vs +179.9 MiB) serving a ~415 MB running-task log (full benchmark in #69299).

What

  • Implement get_streaming_task_log on KubernetesExecutor; get_task_log stays and delegates to it, so older cores keep working.
  • Advertise supports_streaming_logs on KubernetesExecutor, CeleryKubernetesExecutor, and LocalKubernetesExecutor (the wrappers route kubernetes-queue tasks).
  • Update log handler tests to assert the streaming read path for running tasks.

Was generative AI tooling used to co-author this PR?

Reading a running task's log through an executor materializes the whole
log in the API server before the bounded LogStreamAccumulator can bound
memory, so large logs spike the API server heap. This adds an interface
executors can implement to stream log lines lazily instead.
Fetching a running task's pod log materialized every line in the API
server before serving it. Streaming the lines lazily through the new
BaseExecutor.get_streaming_task_log interface lets the bounded log
accumulator cap resident memory while serving large logs.
@jason810496 jason810496 force-pushed the refactor/logging/kubernetes-executor-streaming-logs branch from 497b8f2 to a0b19bb Compare July 3, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Executors-core LocalExecutor & SequentialExecutor area:logging area:providers provider:celery provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant