flight-recorder-starter icon indicating copy to clipboard operation
flight-recorder-starter copied to clipboard

JFR File Download does not use transfer-encoding/chunked method

Open tallpsmith opened this issue 4 months ago • 0 comments

I faced an issue using this excellent starter (thank you). Our service was running behind Google Cloud Run which defines a hard limit of 32MB response unless the

from: https://cloud.google.com/run/quotas#cloud_run_limits

Maximum HTTP/1 response size | 32 MiB if not using Transfer-Encoding: chunked or streaming mechanisms

The Download endpoint sets the headers for file transfer, but doesn't specifically return a 'friendly' streaming response (at least not friendly to Google Cloud Run):

https://github.com/mirkosertic/flight-recorder-starter/blob/c47fe6f31fc2f684c0748bdd314ce9acef80ea25/src/main/java/de/mirkosertic/flightrecorderstarter/actuator/FlightRecorderEndpoint.java#L121

I suspect this method would need to change to something like a StreamingResponseBody, possibly?

tallpsmith avatar Feb 29 '24 02:02 tallpsmith