-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
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:
- Set the
Acceptheader toapplication/x-ndjsonin the frontend request. - 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.