New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WS Streams loads the response in memory instead of streaming #11814
Comments
It seems we have performance problème since play 2.8.19 with Play Streams (Akka Streams ?). success =>
success.warnings foreach { w => logger.warn(s"$context Warning: <<<${w.value}>>>") }
val a: Source[ByteString, Unit] = StreamConverters.fromInputStream(() => success.inputStream).mapMaterializedValue(_.onComplete(_ => success.inputStream.close()))
Ok.streamed(
a, None, false,
Some(s"${resultId.value}_-_${
success.metadata.oneMatch.hprimFileS3Key
}_-_${
success.metadata.oneMatch.attachmentFileNameInHprim
}")
).as(applicationPdf) We have a crazy leaks since this version. |
@mohittt8 did you fix your issue by downgrading play or Akka version ? |
@guillaumebadin - We have started using Akka Http. |
Can you please tell exactly from which version you upgraded to what version? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Play Version
2.8.19
API
WS.stream() ( https://www.playframework.com/documentation/2.8.x/ScalaWS#Processing-large-responses )
Scala
Operating System
Mac OS
JDK
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment Corretto-11.0.18.10.1 (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.18.10.1 (build 11.0.18+10-LTS, mixed mode)
Library Dependencies
WS
Code to reproduce the issue -
Expected behaviour -
The code execution inside the res future as soon as first bytes are received.
Actual behaviour -
The code execution inside future does not start till the file is downloaded.
Roughly 20 seconds have passed when the code execution reaches inside the res future. It is the same amount of time to download 150MB of image on my network.
I get the same effect if I use .get() instead of .stream()
The text was updated successfully, but these errors were encountered: