Skip to content

Conversation

@jason810496
Copy link
Member

related issue: #45079
related PR: #45129
related discussion on slack: https://apache-airflow.slack.com/archives/CCZRF2U5A/p1736767159693839


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:logging area:webserver Webserver related Issues labels Jan 22, 2025
@Lee-W Lee-W added the legacy api Whether legacy API changes should be allowed in PR label Jan 22, 2025
@jason810496 jason810496 force-pushed the refactor/webserver-oom-for-large-log-read-back-port branch 5 times, most recently from cc217a5 to e9e1891 Compare January 23, 2025 11:34
@jason810496 jason810496 marked this pull request as ready for review January 24, 2025 03:04
@jason810496 jason810496 force-pushed the refactor/webserver-oom-for-large-log-read-back-port branch from f08efca to 2c1a3cc Compare January 29, 2025 14:54
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - few nits, but I think this is a great improvement.

@potiuk potiuk added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Apr 29, 2025
@potiuk potiuk modified the milestones: Airflow 2.11.0, Airflow 3.0.1 Apr 29, 2025
@potiuk
Copy link
Member

potiuk commented Apr 29, 2025

I marked it as 3.0.1 - because technically - it is bugfix, though we might refrain from merging it to 3.0.1 - up to @kaxil to decide, but I would be inclined to include it, especially if we decide to also release it in 2.11 - it would be strange to have it in 2.11.0 but not have it in 3.0.*

@jason810496
Copy link
Member Author

jason810496 commented Apr 29, 2025

Hi @potiuk, #49470 targets the 3.0+ branch, since there are significant changes to FileTaskHandler introduced in Airflow 3.0, as detailed in the #49470 description. ( introduce StructuredLogMessage and RemoteIO to FileTaskHandler in 3.0 )

Backporting this one (#45914) directly would likely result in conflicts. However, it should be no problem to backport #49470 to the v3-0-test branch instead.

@jason810496 jason810496 force-pushed the refactor/webserver-oom-for-large-log-read-back-port branch 2 times, most recently from 133624d to 09799f4 Compare April 30, 2025 12:43
@kaxil kaxil changed the base branch from v2-10-test to v2-11-test April 30, 2025 18:58
@kaxil kaxil changed the title [v2-10-test] Resolve OOM When Reading Large Logs in Webserver [v2-11-test] Resolve OOM When Reading Large Logs in Webserver Apr 30, 2025
dependabot bot and others added 10 commits May 1, 2025 00:28
Bumps [trove-classifiers](https://github.com/pypa/trove-classifiers) from 2025.4.11.15 to 2025.4.28.22.
- [Release notes](https://github.com/pypa/trove-classifiers/releases)
- [Commits](pypa/trove-classifiers@2025.4.11.15...2025.4.28.22)

---
updated-dependencies:
- dependency-name: trove-classifiers
  dependency-version: 2025.4.28.22
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- test_interleave_interleaves
- test_interleave_logs_correct_ordering
- test__read_for_celery_executor_fallbacks_to_worker
@kaxil kaxil force-pushed the refactor/webserver-oom-for-large-log-read-back-port branch from 09799f4 to 246e4fb Compare April 30, 2025 18:58
message = str(next(iter(log_streams[0])))
while metadata["end_of_log"] is False:
logs, metadata = task_log_reader.read_log_chunks(
hosts, log_streams, metadata = task_log_reader.read_log_chunks(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a big change, I am afraid to include it in 2.11!

For example, in this case where the return type of task_log_reader.read_log_chunks has changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaxil it seems he is intending this to go to 3.0 only
#45914 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we should not spend time adding meaningful changes to 2.x

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, in this case where the return type of task_log_reader.read_log_chunks has changed.

I think changing the return type of read_log_chunks or other internal methods isn't a problem, since the user-facing interface is the REST API. As long as the REST API response remains consistent, users won’t be affected or need to be aware of the refactor.

@kaxil
Copy link
Member

kaxil commented Apr 30, 2025

Great PR @jason810496 but I am worried about backwards compatibility with this change -- especially for cases where an external provider has built upon the 2.10.5 logging format or clients using /log endpoint with json.

cc @dstandish @uranusjr @ashb Any opinion from you folks since you are more familiar with our logging architecture? My recommendation is to not include this in 2.x and close this and review #49470 for 3.1

@jason810496 jason810496 force-pushed the refactor/webserver-oom-for-large-log-read-back-port branch from 246e4fb to 6cef899 Compare May 1, 2025 05:20
@jason810496
Copy link
Member Author

jason810496 commented May 1, 2025

Great PR @jason810496 but I am worried about backwards compatibility with this change -- especially for cases where an external provider has built upon the 2.10.5 logging format or clients using /log endpoint with json.

Just clarify this change about break backward compatibility for log serving.

cc @dstandish @uranusjr @ashb Any opinion from you folks since you are more familiar with our logging architecture? My recommendation is to not include this in 2.x and close this and review #49470 for 3.1

That works for me as well.


Thanks for the review, @potiuk and @kaxil!

@kaxil kaxil removed this from the Airflow 3.0.1 milestone May 6, 2025
@kaxil kaxil closed this May 6, 2025
@kaxil
Copy link
Member

kaxil commented May 6, 2025

Thanks @jason810496 , will review #49470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:logging area:webserver Webserver related Issues backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch legacy api Whether legacy API changes should be allowed in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants