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

Finish him. #566

Merged
merged 12 commits into from
Mar 26, 2014
Merged

Finish him. #566

merged 12 commits into from
Mar 26, 2014

Conversation

cmeiklejohn
Copy link
Contributor

Resolve the remaining dialyzer errors on repl. Flawless victory.

Refactor functions so Dialyzer can more easily determine the types
originating from particular callers.

Resolves:

riak_repl_keylist_client.erl:331: The pattern 'cancel_fullsync' can never match the type 'pause_fullsync'
Ignore invalid specs to unset_env; they are valid with tuples and
execute correctly, however, moving forward we should not use it because
OTP has updated the spec to reflect only the specific calls they want to
support moving forward.
Provide an actual return value to prevent the no local return error
message.

Resolves:

riak_repl_console.erl:288: The created fun has no local return
@seancribbs
Copy link

At first glance these seem ok to me, but I'm not a repl domain expert. This leaves only these remaining errors:

riak_core_connection_mgr.erl:494: The pattern 'ok' can never match the type {'error',atom()}
riak_repl_aae_source.erl:574: The pattern <MsgType, Msg, State> can never match since previous clauses completely covered the type <7,binary(),#state{index::'undefined' | non_neg_integer(),indexns::'undefined' | [{_,_}],tree_pid::'undefined' | pid(),tree_mref::'undefined' | reference(),built::'undefined' | non_neg_integer(),timeout::'undefined' | pos_integer(),wire_ver::atom(),diff_batch_size::non_neg_integer(),local_lock::boolean(),owner::'undefined' | pid()}>
riak_repl_console.erl:284: The created fun has no local return
riak_repl_console.erl:285: The pattern {'ok', Members} can never match the type [{string(),non_neg_integer()}]

@cmeiklejohn
Copy link
Contributor Author

Those will be addressed in a separate PR.

end,
log_stop(Command, State),
wait_ack(cancel_fullsync, #state{sitename=SiteName} = State) ->
NewState = application:unset_env(riak_repl, {progress, SiteName}),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct value for NewState.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. This was resolved in 6bb6262.

@Vagabond
Copy link

I don't understand the reason for this ignore:

riak_repl_keylist_client.erl:330: The pattern 'cancel_fullsync' can never match the type 'pause_fullsync'

@Vagabond
Copy link

The rest of this looks fine.

@cmeiklejohn
Copy link
Contributor Author

As best as I could tell via Typer, the unset_env and set_env calls which are producing errors because Dialyzer feels they will never succeed, causes it to identify that the cancel_fullsync branch will never be reached.

@Vagabond
Copy link

You could move the log message before the (un)set_env calls, that should shut things up without doing anything other than logging a few instructions earlier.

Reorder log messages to prevent the incorrectly specified set_env and
unset_env calls from generating false errors.
@cmeiklejohn
Copy link
Contributor Author

Addressed logging issues with e30d78f.

Resolves:

riak_repl_console.erl:284: The created fun has no local return
riak_repl_console.erl:285: The pattern {'ok', Members} can never match the type [{string(),non_neg_integer()}]
Regardless of the correct type specifications on sync_connect and
sync_connect_status, dialyzer still believes that this function can
never return 'ok' because the ranch call is thought to have failed
because of the improper specification.

See existing ignores related to ranch_tcp.
All callers of this function use encode_obj_msg, which never returns a
non-binary, so crash if that is the case.
@cmeiklejohn cmeiklejohn changed the title More dialyzer. Finish him. Mar 25, 2014
@cmeiklejohn
Copy link
Contributor Author

Depends on basho/riak_kv#882.

@Vagabond
Copy link

+1 on this.

cmeiklejohn added a commit that referenced this pull request Mar 26, 2014
@cmeiklejohn cmeiklejohn merged commit 383757e into develop Mar 26, 2014
@cmeiklejohn cmeiklejohn deleted the bugfix/csm/dialyzer branch March 26, 2014 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants