Skip to content
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

Merged
merged 2 commits into from Jun 4, 2013
Merged

Conversation

evanmcc
Copy link
Contributor

@evanmcc evanmcc commented Jun 3, 2013

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

@@ -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) ->
Copy link
Contributor

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).
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

@jrwest
Copy link
Contributor

jrwest commented Jun 4, 2013

client_java_verify passes for me w/ these changes

@jrwest
Copy link
Contributor

jrwest commented Jun 4, 2013

+1

evanmcc added a commit that referenced this pull request Jun 4, 2013
update bad value protection for timer value
@evanmcc evanmcc merged commit b5b94dd into master Jun 4, 2013
@seancribbs seancribbs deleted the pevm-timeout-guard branch April 1, 2015 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants