softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.53k stars 193 forks source link

Timeouts for 20 second long poll requests #9

Closed trvrnrth closed 11 years ago

trvrnrth commented 11 years ago

Hi,

When performing a long poll of 20 seconds (the longest allowed by SQS) I'm getting responses of The server was not able to produce a timely response to your request. or There was an internal server error.

This looks to be an internal timeout: 14:01:43.897 [elasticmq-akka.actor.default-dispatcher-13] ERROR o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Exception when running routes akka.pattern.AskTimeoutException: Timed out at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:312) ~[elasticmq-server-0.7.0.jar:0.7.0] at akka.actor.DefaultScheduler$$anon$8.run(Scheduler.scala:191) ~[elasticmq-server-0.7.0.jar:0.7.0] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:137) [elasticmq-server-0.7.0.jar:0.7.0] at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506) [elasticmq-server-0.7.0.jar:0.7.0] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) [elasticmq-server-0.7.0.jar:0.7.0] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [elasticmq-server-0.7.0.jar:0.7.0] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) [elasticmq-server-0.7.0.jar:0.7.0] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [elasticmq-server-0.7.0.jar:0.7.0] 14:01:43.900 [elasticmq-akka.actor.default-dispatcher-13] WARN akka://elasticmq/user/IO-HTTP/listener-0/1 - Cannot dispatch HttpResponse as response (part) for POST request to 'http://queue1.internal.office.blubolt.com:9324/queue/PPDActions' since current response state is 'Completed' but should be 'Uncompleted'

I haven't tried raising any of the various timeouts in the application config, but can confirm that long polls of, for example, 10 seconds work just fine.

Let me know if you need any further information.

Cheers, Trevor

adamw commented 11 years ago

Thanks for the report. The default Spray request timeout was exactly 20 seconds, so there was no time to complete the request (requests with 19 seconds completed successfully). I fixed that in master; to adjust the existing version you can simply add an application.conf file and add spray.can.server.request-timeout = 21 s to it.