processone/tsung — pull request #100 by tisba (2014-08-10 12:54:10+00:00)
Title: handle ssl_closed in ts_client

While running a load test which overloaded the load balancer (which also happens to do the SSL/TLS termination) I got **many hundred thousands** of the following log entries across all generators. **This induced quite a stress on the controller node, in my opinion for no good reason.**

This pull request aims to avoid the extensive logging of those events:

```
=INFO REPORT==== 7-Aug-2014::11:54:47 ===
ts_client:(4:<0.31230.0>) connection close while sending message !

=INFO REPORT==== 7-Aug-2014::11:54:47 ===
ts_client:(3:<0.31230.0>) Error: Unknown msg {ssl_closed,
{sslsocket,
{gen_tcp,
#Port<0.18586>,
tls_connection},
<0.31231.0>}} receive in state think, stop
```

When I understand correctly, `ts_client` gets notified about the `tcp_closed` and `ssl_closed` (see [ssl](http://www.erlang.org/doc/man/ssl.html)) events separately, but only handles `tcp_closed`. This results in the client/user process termination, although the error could have been recovered (given there are retries left).

I also lowered the log level for `connection close while sending message` messages and added `ts_mon:add({ count, error_connection_closed })` instead. For my understanding, losing a TCP connection is not worth a warning, but a rather normal effect of load tests.