Hi All,
I'm having a problem when running many simultaneous clients that connect to same server binding. I covered this problem in a unit test. The source code can be found here
PeerCloseSpec.scala This is what it does
- Creating a tcp server that accepts all incoming connection and for each of connection it sums the size of each incoming ByteString and finishes a promise onComplete.
- Creating 300 clients that create an InputStream of same specific size and stream it via tcp connection to the server.
- Asserting that server received all 300 streams of specified size.
Assertion is not passing for some of the clients and they report `The connection closed with error Connection reset by peer` in the middle of streaming. This problem only appears when number of clients is big. If setting number to a lower number, i.e 10, test passes.
Could you please have a look and suggest if it is the right way to use akka-stream library when multiple connection have to be established or it is possible a bug in the library itself?
Another interesting point is how fast the test fails depends on system. Using Fedora 3.19.7-200.fc21.x86_64 brings the error only when higher number of clients are started. When using mac, test may fail already with ~30 clients.
Thanks!