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
update bad value protection for timer value #332
Conversation
@@ -195,6 +197,10 @@ init({test, Args, StateProps}) -> | |||
%% @private | |||
maybe_start_timeout_timer(infinity) -> | |||
ok; | |||
maybe_start_timeout_timer(Bad) when not is_integer(Bad) -> | |||
maybe_start_timeout_timer(?DEFAULT_TIMEOUT); | |||
maybe_start_timeout_timer(undefined) -> |
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.
this clause is covered by the previous one
@@ -97,6 +97,8 @@ behaviour_info(callbacks) -> | |||
behaviour_info(_) -> | |||
undefined. | |||
|
|||
-define(DEFAULT_TIMEOUT, 60000*8). |
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.
what's the reasoning behind this default? is it just supposed to be greater than all the other timeouts in layers above?
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.
It's the same default that's defined in the client.
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.
ok cool. just wanted to know its origin. thanks
|
+1 |
update bad value protection for timer value
Since there are many paths to spawn a coverage FSM, it would be a lot of code duplication to validate the timeout at each of those entry points. Instead, expand may_start_timeout_timer to guard against more categories of bad input.
Fixes basho/riak_kv#571
cc @jrwest @seancribbs