Anyone seen lost responses using Spray HttpClient/HttpConduit?

42 views
Skip to first unread message

Kevin Esler

unread,
Apr 19, 2013, 6:21:12 PM4/19/13
to spray...@googlegroups.com
I have a system in production using Spray client libraries. It is POSTing payloads at a fairly rapid rate to a single consuming endpoint. It can keep up to 30 POSTs in flight at once and sends several hundred a minute at times.

I set the request timeout on setting on the HttpClient to be 30 seconds, and the idle timeout to be 35 seconds.

Here is what I observe: after a certain period, of the order of 20 minutes, my code has:

  - initiated 9237 POSTs
  - received 7 failures (Future[HttpResponse].onFailure() calls)
  - received 9205 successes (Future[HttpResponse].onSuccess() calls)

So 25 of the initiated POSTs never resulted in a response, nor a timeout.

Has anybody observed anything like this?

I am using:

  Spray 1.0-M7
  Akka 2.0.4
  Scala 2.9.2

Any reason to believe that upgrading to Spray 1.1-M7, Akka 2.1.2 and Scala 2.10 might help?

I can of course code around this by checking for missing responses myself.



Mathias

unread,
Apr 22, 2013, 4:24:01 AM4/22/13
to spray...@googlegroups.com
Kevin,

hmm… this is interesting.
We haven't noticed any "lost" requests in our own applications, but I do not want to rule out the possibility of a race condition somewhere causing this.
In general we weren't too happy with the client-side code up to M7 ourselves, which is why this part has been rewritten almost from scratch and significantly improved in the latest nightlies.

> Any reason to believe that upgrading to Spray 1.1-M7, Akka 2.1.2 and Scala
> 2.10 might help?

I don't think upgrading to the 1.1-M7 will do the trick.
However, upgrading to the latest nightlies has a strong chance of the problem disappearing (and hopefully not being replaced by another one).
Since the client-side API has changed somewhat this upgrade might be a bit more work though…
Let us know if you need support with such an upgrade.

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Kevin Esler

unread,
Apr 22, 2013, 10:05:49 AM4/22/13
to spray...@googlegroups.com
Thanks Mathias. The problem began when we changed from doing one POST at a time to doing N, where N is or so.

For now I have added some logging to learn more about what is happening, and also some code to notice and retry the requests for the "lost" responses.

I will aim to move to the new client code as soon as is practical.
Reply all
Reply to author
Forward
0 new messages