New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HC: Lazy leader #4183
HC: Lazy leader #4183
Conversation
{error, not_leader}; | ||
ok -> | ||
{ok, Leader} | ||
end; | ||
{error, What} -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have an eventual timeout somewhere or will it carry on forever?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would guess no timeout - we don't timeout on trying to find a PoW solution either. Also the next leader is being elected by a contract and could use some block time in its calculations so if Alice is not a leader now, she could be in 10 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -202,7 +214,7 @@ post_request(Path, Body, Host, Port, Timeout) -> | |||
{ok, {{_, 200 = _Code, _}, _, Res}} -> | |||
lager:debug("Req: ~p, Res: ~p with URL: ~ts", [Req, Res, Url]), | |||
{ok, jsx:decode(list_to_binary(Res), [return_maps])}; | |||
{ok, {{_, 400, _}, _, Res}} -> | |||
{ok, {{_ ,400, _}, _, Res}} -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
HC Lazy leader implementation
Closes #3929
The work on this PR has been supported by ACF.