Detail: akka.stream.StreamTcpException: Connection failed.

1,649 views
Skip to first unread message

Chaitanya Mahipath

unread,
Feb 27, 2017, 2:25:37 AM2/27/17
to Akka User List
Hi,

I am using the akka http scaladsl library to do a HTTP calls against a server. I am running a test where I have 15 threads running concurrently each making around 250 GET calls(15*250). Trying to run this test for three hours but I see that after two and half hours of execution I could see
Detail: akka.stream.StreamTcpException: Connection failed. exception being thrown.

Initially I thought the servers isn't accepting the incoming requests. But, ran the same test directly against the server and could see no issues.
Code snippet to connect to the server -

connectionFlow= Http(context.system).outgoingConnectionTls(req.uri.authority.host.address(), port)
Source.single(req.withUri(req.uri.toRelative)).via(connectionFlow).runWith(Sink.head) - Here, req is the HttpRequest.

Could someone please help me out why is that StreamTcpException exception is thrown?

Johannes Rudolph

unread,
Feb 27, 2017, 3:29:10 AM2/27/17
to Akka User List
Hello,

the error is thrown here: https://github.com/akka/akka/blob/master/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala#L303. I agree it's hard to see why that error would happen. One thing that could have happened is that a connection attempt was very slow and so the idle-timeout kicked in and killed the TCP stage before a connection was established. Either there was a real connection problem, or the infrastructure didn't make progress in due time e.g. because of a thread starvation issue.

Btw. using `Source.single().via(connectionFlow).runWith(Sink.head)` is discouraged. Please use `Http.singleRequest` instead. See also the note at http://doc.akka.io/docs/akka-http/current/scala/http/client-side/host-level.html#host-level-api.

HTH
Johannes

Chaitanya Mahipath

unread,
Feb 27, 2017, 6:27:34 AM2/27/17
to Akka User List
Hi Johannes,

I tried with Http.SingleRequest as suggested but could see the following exception

akka.stream.BufferOverflowException: Exceeded configured max-open-requests value of [32]

This time the test has lasted only for 40 odd minutes(as compared to previous test result which lasted for over 2hrs 30mins.). Could you please let me know what configuration changes should be made?

Viktor Klang

unread,
Feb 27, 2017, 6:36:53 AM2/27/17
to Akka User List
Are you consuming your response bodies?

--
Cheers,

--
>>>>>>>>>> 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+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Chaitanya Mahipath

unread,
Feb 27, 2017, 7:19:20 AM2/27/17
to Akka User List
Yes. Status code, headers & the content using entity.toStrict.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.

Chaitanya Mahipath

unread,
Feb 28, 2017, 7:26:17 AM2/28/17
to Akka User List
Please provide your inputs to overcome this problem.
Any help is greatly appreciated!

Thanks,
Chaitanya 
Reply all
Reply to author
Forward
0 new messages