pierrejeambrun commented on code in PR #63180: URL: https://github.com/apache/airflow/pull/63180#discussion_r2989371521
########## airflow-core/src/airflow/api_fastapi/core_api/routes/public/log.py: ########## @@ -59,6 +62,19 @@ } +def _batched_ndjson_stream( + raw_stream: Iterable[str], +) -> Generator[str, None, None]: + buf: list[str] = [] + for line in raw_stream: + buf.append(line) + if len(buf) >= _NDJSON_BATCH_SIZE: + yield "".join(buf) + buf.clear() Review Comment: What happens if logs are being streamed, we are waiting for more logs to come in and we do not have enough lines to yield a full batch? Won't this stay blocked until the task actually finishes? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
