Failed due to POST request to /path/to/my/route timed out
Note that, at this time, that I had not overridden any `spray.can.client` config values.
Having observed that the HTTP request had succeeded, i.e. checking the UI of the web service, but the client reported failure, it seemed that I needed to increase my client-side timeout.
So, I updated my `application.conf`:
spray.can.client {
request-timeout = 2 minutes
idle-timeout = 130 seconds
}
However, in my main method, when I block:
val result = Await.result(future, 2.minutes)
I observed the following error:
Failed due to Ask timed out on [Actor[akka://default/user/IO-HTTP#...]] after [60000 ms]
This error confused me since I had expected the spray.can.client settings to have overridden the 20 s default:
# If a request hasn't been responded to after the time period set here # a `spray.http.Timedout` message will be sent to the timeout handler. # Set to `infinite` to completely disable request timeouts. request-timeout = 20 sFinally, I saw a spray maintainer comment in this StackOverflow question - akka timeout when using spray client for multiple request.
That's the timeout ofsendReceive
. See github.com/spray/spray/blob/master/spray-client/src/main/scala/… You can adapt it by providing another implicitTimeout
in scope. E.g.implicit val timeout = Timeout(120.seconds)
So, at this point, I'm confused as to what config value or implicit that I need to add to force this client to wait 120 seconds before failing the request.
"The server was not able to produce a timely response to your request."