Search before asking
What happened
When a user downloads a large task log, the apiserver can run out of memory. The whole RPC response body is read into memory at once. In our heap dump we saw a TransporterDecoder whose body was a byte[] of ~226MB — it was a queryTaskResult response. On 3.3.2 the decoder does new byte[bodyLength] without any size check, so any large response gets allocated whole.
Also, once a maxFrameSize guard is in place, a task log larger than the frame limit can no longer be downloaded — the log is returned as one big byte[] in a single RPC, so the request is rejected.
What you expected to happen
Large task logs should still be downloadable (streamed in chunks, not one big RPC), and the server shouldn't OOM on a large response.
How to reproduce
- Run a task that produces a large log file.
- Click "Download full log" or view the task result.
- On 3.3.2 the apiserver OOMs; with the frame guard, the large-log download fails.
Anything else
The OOM side is handled by the maxFrameSize check in TransporterDecoder. This issue also tracks making large-log download work under that limit (stream the log in chunks).
Version
3.3.2
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
When a user downloads a large task log, the apiserver can run out of memory. The whole RPC response body is read into memory at once. In our heap dump we saw a
TransporterDecoderwhosebodywas abyte[]of ~226MB — it was aqueryTaskResultresponse. On 3.3.2 the decoder doesnew byte[bodyLength]without any size check, so any large response gets allocated whole.Also, once a
maxFrameSizeguard is in place, a task log larger than the frame limit can no longer be downloaded — the log is returned as one bigbyte[]in a single RPC, so the request is rejected.What you expected to happen
Large task logs should still be downloadable (streamed in chunks, not one big RPC), and the server shouldn't OOM on a large response.
How to reproduce
Anything else
The OOM side is handled by the
maxFrameSizecheck inTransporterDecoder. This issue also tracks making large-log download work under that limit (stream the log in chunks).Version
3.3.2
Are you willing to submit PR?
Code of Conduct