From 35e8efeb967f72ee9b147b8130771048a9812199 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Fri, 11 Sep 2015 15:56:02 +0900 Subject: [PATCH] Add timer:sleep() to accomodate machi_chain_manager1_converge_demo --- src/machi_chain_manager1.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/machi_chain_manager1.erl b/src/machi_chain_manager1.erl index 90aa324..84ed393 100644 --- a/src/machi_chain_manager1.erl +++ b/src/machi_chain_manager1.erl @@ -1330,7 +1330,18 @@ react_to_env_A40(Retries, P_newprop, P_latest, LatestUnanimousP, AmHosedP, LatestUnanimousP, AmHosedP, Rank_newprop, Rank_latest, S); true -> - ?REACT({a40, ?LINE, []}), + ?REACT({a40, ?LINE, [{q1,P_current#projection_v1.upi}, + {q2,P_current#projection_v1.repairing}, + {q3,P_newprop#projection_v1.upi}, + {q4,P_newprop#projection_v1.repairing}, + {q5, ExpectedUPI}]}), + %% Ha, there's a "fun" sync problem with the + %% machi_chain_manager1_converge_demo simulator: + %% two servers could get caught in a mutual lock- + %% step that we would end up in this branch 100% + %% of the time because each would only ever see + %% P_newprop authored by the other server. + timer:sleep(random:uniform(100)), react_to_env_C300(P_newprop, P_latest, S) end; true ->