The connection actor has terminated. Stopping now.

I’m working on a REST API that uses Akka, we inherited it from a previous team, and none of us have experience with Akka before this.

Akka is being used to process the data the API is returning, and acting as the HTTP server.

Recently when the API was under load, we started getting failures like so:

),HttpProtocol(HTTP/1.1)), Response: HttpResponse(500 Internal Server Error,List(),HttpEntity.Strict(text/plain; charset=UTF-8,
Error Code: 500
Type: Internal Server Error
Stack Trace:
akka.stream.StreamTcpException: The connection actor has terminated. Stopping now.
),HttpProtocol(HTTP/1.1)), Time: 6430 ms

I have no idea where the above error is happening in the code, or how to appropriately handle this error when it happens.

Can anyone give suggestions on how to trace this down further, or suggestions on how to handle and recover from these types of issues?