-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Resolve OOM When Reading Large Logs in Webserver #49470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jason810496
wants to merge
67
commits into
apache:main
Choose a base branch
from
jason810496:refactor/rework-webserver-oom-for-large-log-read
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Resolve OOM When Reading Large Logs in Webserver #49470
jason810496
wants to merge
67
commits into
apache:main
from
jason810496:refactor/rework-webserver-oom-for-large-log-read
+1,432
−271
Conversation
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
d47a49b
to
2f5a202
Compare
4e1bcb4
to
358f231
Compare
358f231
to
9900b2e
Compare
3ee834b
to
c97bc9a
Compare
- use itertools.isslice to get chunk
Lee-W
reviewed
Jun 17, 2025
Thanks @Lee-W for the review, I will mark the PR as Draft while fixing. |
2 tasks
- _is_logs_stream_like - add type annotation - reduce to 1 isinstance call - construct log_streams in _get_compatible_log_stream inline - use TypeDict for LogMetadata - remove len(logs) to check empty - revert typo of self.log_handler.read in log_reader - log_stream_accumulator - refactor flush logic - make totoal_lines as property - make stream as property
e78bdeb
to
630270c
Compare
630270c
to
97ab0de
Compare
Lee-W
reviewed
Jun 21, 2025
- refactor structured_logs fixtures in TestLogStreamAccumulator - use f-strign in test_file_task_handler - assert actual value of _create_sort_key - add details comments in test__add_log_from_parsed_log_streams_to_heap
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.
related issue: #45079
related PR: #45129
related discussion on slack: https://apache-airflow.slack.com/archives/CCZRF2U5A/p1736767159693839
Why
In short, this PR aims to eliminate OOM issues by:
yield
generators instead of returning a list of strings)More detailed reasoning is already described in the linked issue.
Due to too many conflicts with the old PR (#45129), this PR reworks the changes on top of the latest
FileTaskHandler
.What
This PR ports the original changes from #45129 to the current version of
FileTaskHandler
with the following updates:Note: Recent Changes in
FileTaskHandler
StructuredLogMessage
to represent each log record Render structured logs in the new UI rather than showing raw JSON #46827RemoteLogIO
interface for remote log handling Rework remote task log handling for the structlog era. #48491