akka.pattern.AskTimeoutException while running Lagom HelloWorld example

akka
scala
java

(Aseem) #1

Hello,

I have a problem while trying my hands on the Hello World example explained here.

Kindly note that I have just modified the HelloEntity.java file to be able to return something other than “Hello, World!”. Most certain my changes are taking time and hence I am getting the below Timeout error. I am currently trying (doing a PoC) on a single node to understand the Lagom framework and do not have liberty to deploy multiple nodes.

I have also tried modifying the default lagom.circuit-breaker in application.conf “call-timeout = 100s” however, this does not seem to have helped.

Following is the exact error message for your reference:

{“name”:“akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://hello-impl-application/system/sharding/HelloEntity#1074448247]] after [5000 ms]. Sender[null] sent message of type “com.lightbend.lagom.javadsl.persistence.CommandEnvelope”.”,“detail”:“akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://hello-impl-application/system/sharding/HelloEntity#1074448247]] after [5000 ms]. Sender[null] sent message of type “com.lightbend.lagom.javadsl.persistence.CommandEnvelope”.\n\tat akka.pattern.PromiseActorRef$.$anonfun$defaultOnTimeout$1(AskSupport.scala:595)\n\tat akka.pattern.PromiseActorRef$.$anonfun$apply$1(AskSupport.scala:605)\n\tat akka.actor.Scheduler$$anon$4.run(Scheduler.scala:140)\n\tat scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:866)\n\tat scala.concurrent.BatchingExecutor.execute(BatchingExecutor.scala:109)\n\tat scala.concurrent.BatchingExecutor.execute$(BatchingExecutor.scala:103)\n\tat scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:864)\n\tat akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:328)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.executeBucket$1(LightArrayRevolverScheduler.scala:279)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick(LightArrayRevolverScheduler.scala:283)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.run(LightArrayRevolverScheduler.scala:235)\n\tat java.lang.Thread.run(Thread.java:748)\n”}

Question: Is there a way to increase the akka Timeout by modifying the application.conf or any of the java source files in the Hello World project? Can you please help me with the exact details.
Thanks in advance for you time and help.

Regards,
Aseem


(Ignasi Marimon-Clos) #2

Hi Aseem,

the call to a PersistentEntity doesn’t use circuit breakers so your settings is not being used on this case.
What you are looking for is lagom.persistence.ask-timeout which defaults to 5s.

HTH,


(Aseem) #3

Thanks for your reply.
Could you please provide details on how to set lagom.persistence.ask-timeout parameter? Do I have to set this value in application.conf or any of the java source files in the Hello World project?

Thanks in advance.
Regards,
Aseem


(Aseem) #4

Thanks @ignasi35 for the help/pointer.
Adding following lines to resources/application.conf did the trick for me:

lagom.persistence.ask-timeout=30s
hello {


call-timeout = 30s
call-timeout = ${?CIRCUIT_BREAKER_CALL_TIMEOUT}

}

However, not really sure what is the relation/difference between the lagom.persistence.ask-timeout & call-timeout.


(Ignasi Marimon-Clos) #5

That’s a good question indeed. :smiley:

A Call is a Service-to-Service communication. That’s a SeviceClient communicating to a remote server. It uses a circuit breaker. It is a extra-service call.

An ask (in the context of lagom.persistence) is sending a command to a persistent entity. That happens across the nodes insied your Lagom service. It is not using circuit breaking. It is an intra-service call.

HTH,


(Aseem) #6

Thanks @ignasi35 for the clarification. :-)