xmg333 opened a new pull request, #18463: URL: https://github.com/apache/dolphinscheduler/pull/18463
## Was this PR generated or assisted by AI? YES. Implementation and tests drafted with assistance from Claude (Anthropic); reviewed by human. ## Purpose of the pull request `getFileContentBytesFromLocal` read entire files into memory with no size limit. Downloading a large task log caused OOM on the worker. This PR caps the read at 47 MB and returns a clear error for oversized logs. **Why 47 MB, not 64 MB?** The `byte[]` is JSON-serialized as base64 (~1.33× expansion) before RPC transmission. 47 MB raw → ~63 MB JSON body, staying under the 64 MB `maxFrameSize` in `TransporterDecoder`. 64 MB raw would produce ~86 MB body and be rejected by `TooLongFrameException`. ## Brief change log - `LogUtils`: add `MAX_LOG_DOWNLOAD_SIZE = 47 MB`; `getFileContentBytesFromLocal` stops reading once the limit is reached. - `LogServiceImpl`: checks file size before reading; returns `ERROR` with a clear message for oversized logs instead of silently truncating. ## Verify this pull request This change added tests and can be verified as follows: - `LogServiceImplTest`: a 48 MB file returns `ERROR` with message containing "exceeds maximum download size". - `./mvnw spotless:check` passes. ## Pull Request Notice [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) -- 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]
