Repository navigation
Skip log accumulator disk spill when reading finished task logs - #70671
jason810496 merged 10 commits into
Conversation
ff86435 to
d9fbcfb
Compare
0fa14b3 to
b0d2376
Compare
99715a3 to
686cbfa
Compare
Finished-task reads drop the log_pos continuation token from 3.4.0 onward, but the provider test matrix still runs against released cores (3.0-3.3) that emit it. Gate the S3, GCS, and WASB task-handler metadata assertions on AIRFLOW_V_3_4_0_PLUS so both the source run and the older-core compatibility runs pass.
686cbfa to
801e98f
Compare
Apply the log_pos skip and header once for both paths instead of duplicating it in the finished-read branch. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
|
Encountered unrelated CI failure, this PR is ready to review. |
ashb
left a comment
There was a problem hiding this comment.
i'm not sure the tests cover the distinction between the two paths well enough. Can we check does/doesnt accumulation happen
pierrejeambrun
left a comment
There was a problem hiding this comment.
+1 for testing both paths more explicitely.
Otherwise looks good to me.
Cover running, deferred, older-try, and finished reads, including a running task's follow-up poll with an inbound log_pos. Update the _read docstring for the log_pos contract. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Thanks for the review, I added test__read_accumulates_only_unfinished_reads in e4d36e3.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
log_pos is a core detail covered by the core tests, so the provider tests no longer need a version gate for it. Co-Authored-By: Claude <noreply@anthropic.com>
jason810496
left a comment
There was a problem hiding this comment.
Thanks for the review.
uranusjr
left a comment
There was a problem hiding this comment.
FileTaskHandler.read() docstring still says “streaming”; we should fix it.
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…k logs (#70671) * Skip log accumulator disk spill when reading finished task logs * Version-gate remote log handler tests for terminal-state metadata Finished-task reads drop the log_pos continuation token from 3.4.0 onward, but the provider test matrix still runs against released cores (3.0-3.3) that emit it. Gate the S3, GCS, and WASB task-handler metadata assertions on AIRFLOW_V_3_4_0_PLUS so both the source run and the older-core compatibility runs pass. * Add plan for incremental UI log fetch via continuation token * Wrap only unfinished log reads in the stream accumulator Apply the log_pos skip and header once for both paths instead of duplicating it in the finished-read branch. * Drop the accidentally committed planning doc * Test both accumulator paths of FileTaskHandler._read Cover running, deferred, older-try, and finished reads, including a running task's follow-up poll with an inbound log_pos. Update the _read docstring for the log_pos contract. * Drop the misleading log_pos note in the log read test * Drop the redundant accumulator comment in the log read test * Assert only end_of_log in the remote log handler tests log_pos is a core detail covered by the core tests, so the provider tests no longer need a version gate for it. * Apply suggestion from @uranusjr to fix the comment Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> --------- (cherry picked from commit 97d4d4e) Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com> Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
…k logs (#70671) (#75956) * Skip log accumulator disk spill when reading finished task logs * Version-gate remote log handler tests for terminal-state metadata Finished-task reads drop the log_pos continuation token from 3.4.0 onward, but the provider test matrix still runs against released cores (3.0-3.3) that emit it. Gate the S3, GCS, and WASB task-handler metadata assertions on AIRFLOW_V_3_4_0_PLUS so both the source run and the older-core compatibility runs pass. * Add plan for incremental UI log fetch via continuation token * Wrap only unfinished log reads in the stream accumulator Apply the log_pos skip and header once for both paths instead of duplicating it in the finished-read branch. * Drop the accidentally committed planning doc * Test both accumulator paths of FileTaskHandler._read Cover running, deferred, older-try, and finished reads, including a running task's follow-up poll with an inbound log_pos. Update the _read docstring for the log_pos contract. * Drop the misleading log_pos note in the log read test * Drop the redundant accumulator comment in the log read test * Assert only end_of_log in the remote log handler tests log_pos is a core detail covered by the core tests, so the provider tests no longer need a version gate for it. * Apply suggestion from @uranusjr to fix the comment --------- (cherry picked from commit 97d4d4e) Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com> Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
part of the streaming task log series
Why
FileTaskHandler._readwraps every read inLogStreamAccumulator, which eagerly drains the whole merged log stream (5000 lines to memory, the rest to a tempfile on the API server) before the first byte reaches the client — only to get thetotal_linesfor the continuation token.For a finished task no continuation token is ever issued (
end_of_log=Trueon both the JSON and NDJSON paths), so the count is dead weight: every terminal-task read full-log downloads — pays a full-log disk write + read-back + re-parse and a time-to-first-byte equal to the whole drain, for nothing.What
FileTaskHandler._readbypassingLogStreamAccumulatorwhenend_of_logisTrue._interleave_logs(capped atHEAP_DUMP_SIZE, flushing half when full) is what bounds the read path, not the accumulator.Was generative AI tooling used to co-author this PR?