Skip to content

Add streaming task log handler for remote log backends #61499

Description

@stephen-bracken

Description

Most remote log handlers (e.g. S3TaskHandler, ElasticsearchTaskHandler) use the FileTaskHandler as a base logger, which reads a logfile and then serves it to the user. This causes problems for very large log files, as the webserver needs to serve the entire logfile back to the browser before any logs are shown.
On S3 this can cause memory issues because the entire logfile needs to be loaded into memory on the workers before it can be written, and to the webserver's memory before it can be served to the user. This can lead to logs never being written if the worker's thread gets OOMKilled or the webserver crashing if too many users are reading large log files.
On elasticsearch this can also be quite a bad experience because elasticsearch requires reading using paginated queries with a server side limit on the number of logs per page (default 10000 logs).

Use case/motivation

Please add a task log handler base for remote log stores that streams logs during writing, and when reading back to the user.

Related issues

related: #61492

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions