basho/riak_cs — pull request #980 by kuenishi (2014-09-29 09:06:19+00:00)
Title: Add logging when recieved {error, disconnected} to diagnose the cause

This commit adds logging the result of `riakc_pb_socket:is_connected/1`
when Riak CS recieved {error, disconnected} from Riak. This forms a
part of long campaign of connection problem between Riak and Riak CS.
`riakc_pb_socket:is_connected/1` returns `{false, []}` mostly when
TCP connection was closed by Riak - or by Operating System. Sometimes
increasing `somaxconn` or `pb_backlog` helps. If the second element
of the return value, the list of reasons when connecting to Riak
(technically, return value of `gen_tcp:connect` might help diagnosing
the root cause, which is usually outside Riak and Riak CS.

Those logging lines are added to major places where disconneced error
was observed. `riakc_pb_socket` could return disconneced at any call,
potentially, but these logging lines will cover most of them.