akka/akka — pull request #1328 by sirthias (2013-04-10 12:10:32+00:00)
Title: Tone down error logging by explicitly handling handler termination in TcpConnection

Without this patch it is impossible to avoid `DeathPactException` error level log messages resulting from a terminated connection handler if this handler doesn't itself watch the connection actor and only stops itself after having received the respective `Terminated` event.

While this is not wrong per se it complicates API usage since most users simply want to stop their handler after having seen a `Tcp.ConnectionClosed` event (and therefore avoid the additional step of waiting for `Terminated(connection)`).

This patch adds explicit handling of `Terminated(handler)` events in the `TcpConnection` and reduces logging to one respective `debug` level log message.