Skip to content

Commit b30d6be

Browse files
ian-mijvoegele
authored andcommitted
Use the sanitized reason in connection_mgr state
1 parent 034a0b8 commit b30d6be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/riak_core_connection_mgr.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,13 @@ locate_endpoints({Type, Name}, Strategy, Locators) ->
588588
-spec fail_endpoint(ip_addr(), term(), proto_id(), #state{}) -> #state{}.
589589
fail_endpoint(Addr, Reason, ProtocolId, State) ->
590590
%% update the stats module
591-
Stat = {conn_error, reason_to_atom(Reason)},
591+
Err = reason_to_atom(Reason),
592+
Stat = {conn_error, Err},
592593
riak_core_connection_mgr_stats:update(Stat, Addr, ProtocolId),
593594
%% update the endpoint
594595
Fun = fun(EP=#ep{backoff_delay = Backoff, failures = Failures}) ->
595596
erlang:send_after(Backoff, self(), {backoff_timer, Addr}),
596-
EP#ep{failures = orddict:update_counter(Reason, 1, Failures),
597+
EP#ep{failures = orddict:update_counter(Err, 1, Failures),
597598
nb_failures = EP#ep.nb_failures + 1,
598599
backoff_delay = increase_backoff(Backoff),
599600
last_fail_time = os:timestamp(),

0 commit comments

Comments
 (0)