From dd22d45656122413607dcdc945046e33fae54349 Mon Sep 17 00:00:00 2001 From: Ian Milligan Date: Tue, 29 Mar 2016 14:07:07 -0700 Subject: [PATCH] Catch exceptions thrown by the connected callback A failure to call the connected callback should not be treated as a failure to establish a connection. The 'riak_core_connection' process should catch any exceptions thrown by this callback and exit normally. --- src/riak_core_connection.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/riak_core_connection.erl b/src/riak_core_connection.erl index 31fcce0f..6e9c08fb 100644 --- a/src/riak_core_connection.erl +++ b/src/riak_core_connection.erl @@ -235,12 +235,12 @@ handle_info({_TransTag, Socket, Data}, wait_for_protocol, State = #state{socket IpPort = {State#state.ip, State#state.port}, NegotiatedProto = {ProtoName, {CommonMajor, LocalMinor}, {CommonMajor, RemoteMinor}}, _ = Transport:setopts(Socket, State#state.socket_opts), - _ModStarted = Module:connected(Socket, - Transport, - IpPort, - NegotiatedProto, - ModArgs, - State#state.remote_capabilities), + _ModStarted = catch Module:connected(Socket, + Transport, + IpPort, + NegotiatedProto, + ModArgs, + State#state.remote_capabilities), {stop, normal, State}; Else -> lager:warning("Invalid version returned: ~p", [Else]),