Skip to content

Commit

Permalink
Merge pull request #54 from gilbertwong96/hotfix/resiliency
Browse files Browse the repository at this point in the history
Fix resiliency in connect_all mode
  • Loading branch information
zhongwencool authored Aug 9, 2022
2 parents bca0c9b + 73472ed commit c0d7181
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/eetcd.app.src
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{application, eetcd,
[
{description, "ETCD V3 client"},
{vsn, "0.3.5"},
{vsn, "0.3.6"},
{registered, [eetcd_sup, eetcd_conn_sup, eetcd_lease_sup]},
{mod, {eetcd_app, []}},
{applications, [kernel, stdlib, gun]},
{env, []},
{modules, []},

{licenses, ["Apache 2.0"]},
{links, [{"Github", "https://github.com/zhongwencool/eetcd"}]}
]
Expand Down
4 changes: 3 additions & 1 deletion src/eetcd_conn.erl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ do_check_health(connect_all, Data) ->
{Health, [{Host, ?MIN_RECONN} | Freeze]}
end
end, {[], Freezes}, Actives),
NewFreezes1 = [{H1, P1} || {H1, P1} <- NewFreezes, {H2, P2} <- Members, H1 =:= H2, P1 =:= P2],
NewFreezes1 = [{{H1, P1}, RECONN} || {{H1, P1}, RECONN} <- NewFreezes,
{H2, P2} <- Members,
H1 =:= H2, P1 =:= P2],
Data#{active_conns => NewActives, freeze_conns => NewFreezes1};
do_check_health(random, Data) ->
#{name := Name, active_conns := ActiveConns} = Data,
Expand Down

0 comments on commit c0d7181

Please sign in to comment.