A DNS lookup + processing time could take 5 seconds. What happens when you
test the code on known addresses with predictable response times?

-- 
Cheers,
√
On May 5, 2016 2:35 PM, "Edmondo Porcu" <edmondo.po...@gottexbrokers.com>
wrote:

Hello,

I have a trivial use case where I use the Http() inside an actor and the
Connection-Level API to send HttpRequests:

val http = Http(context.system)

def receive = {
   case (x: HttpRequest, requestType: RequestType) =>
     import scala.concurrent.duration._
     requestCount += 1
     val source = sender()
     val r1 = http singleRequest x
     val r2:Future[HttpResponse] = akka.pattern.after(5 seconds, using =
context.system.scheduler)( Future.failed[HttpResponse](new
IllegalStateException(s"After 5 seconds the request $x has not completed")))
     val result = Future firstCompletedOf( r1 :: r2 :: Nil)
     result.map {
       response =>
         source !(requestType, response)
         self ! HTTPResponseReceived
     }.onFailure {
       case e =>
         log.error("Impossible to perform {} {}", e)
         source ! HttpRequestFailure(x, requestType, e.getMessage)
     }
   case HTTPResponseReceived => responseCount += 1
   case GetHTTPActorStatus => sender ! HTTPActorStatus(requestCount,
responseCount)

 }

Some requests time out , as if they were "lost". Given that I have a single
actor per target host, so I could switch to a  cachedConnectionPool and see
if that solve the issue, but that looks like a genuine bug in 2.4.4.
Anyone has encountered a similar problem?

Thank you for your help
Edmondo

--
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives:
https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups
"Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to