Skip to content

AIP-38 Refactor TaskInstance Log UI with Streaming and Virtualized Rendering #50333

@jason810496

Description

@jason810496

Why

The browser can sometimes crash when rendering large logs on the frontend.

After #46827 was merged, the get_log endpoint supports the application/x-ndjson response type, which allows streaming logs in newline-delimited JSON format.
( Once #49470 is merged, the API will fully support streaming responses. )

However, the current frontend still uses the default application/json header instead of application/x-ndjson. When rendering a large JSON response all at once, the browser may crash due to memory overload.

Relevant code:
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/routes/public/log.py#L148-L154

What

This refactor should include:

  1. Set the Accept header to application/x-ndjson in the frontend request.
  2. Use react-window or react-virtualized to efficiently render large log entries.

These changes should be applied to the TaskInstance Log page:
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/Logs.tsx

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

AIP-38Modern Web Applicationarea:APIAirflow's REST/HTTP APIarea:UIRelated to UI/UX. For Frontend Developers.kind:featureFeature Requests

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions