Jarlakxen / drunk

A simple GraphQL client on top of Sangria, Akka HTTP and Circe.
Apache License 2.0
61 stars 21 forks source link

Akka: Implications of the streaming nature of Request/Response Entities #3

Closed NicolasRouquette closed 6 years ago

NicolasRouquette commented 6 years ago

As of v2.3.0 AkkaHttpBackend.send() does not conform with the Akka doc, specifically: https://doc.akka.io/docs/akka-http/current/implications-of-streaming-http-entity.html#discarding-the-http-response-entity-client-, because it does not call discardEntityBytes().

NicolasRouquette commented 6 years ago

Argh... it's not quite fixed; I still get errors like this during shutdown:

https://github.com/akka/akka/issues/18797

[ERROR] [04/12/2018 17:05:50.850] [sttp-akka.actor.default-dispatcher-16] [akka.actor.ActorSystemImpl(sttp)] Outgoing request stream error (akka.stream.AbruptTerminationException: Processor actor [Actor[akka://sttp/system/StreamSupervisor-1/flow-0-0-PoolFlow#-40952605]] terminated abruptly)

I think these comments are also applicable here: https://github.com/akka/akka/issues/18797#issuecomment-157888432 https://github.com/akka/akka/issues/18797#issuecomment-158012205

NicolasRouquette commented 6 years ago

To avoid problems with akka.stream.AbruptTerminationException, I added an alternative backend based on Akka Http Flow Connection (see: https://github.com/akka/akka-http/issues/497#issue-188074838)

Jarlakxen commented 6 years ago

Oh! Nice! Thanks for tackle this issues =) I'm going to review the PR

NicolasRouquette commented 6 years ago

Great!