basho/riak_core — pull request #553 by slfritchie (2014-03-17 07:21:54+00:00)
Title: Allow handoff sender to abort handoff by throw'ing from fold fun

Depends upon: https://github.com/basho/riak_kv/pull/869

There's no reason why the handoff sender fold fun has to continue
folding when there's a TCP error. Instead, throw the #ho_acc{}
record with its error={error,Reason} field intact.

If we force the handoff receiver to exit (using exit(HO_pid, kill)),
then we simply see the following logged on the sender side:

2014-03-17 15:53:30.949 [error] <0.27207.2>@riak_core_handoff_sender:start_fold:266 hinted_handoff transfer of riak_kv_vnode from 'dev1@127.0.0.1' 1415829711164312202009819681693899175291684651008 to 'dev2@127.0.0.1' 1415829711164312202009819681693899175291684651008 failed because of closed
2014-03-17 15:53:30.950 [error] <0.220.0>@riak_core_handoff_manager:handle_info:289 An outbound handoff of partition riak_kv_vnode 1415829711164312202009819681693899175291684651008 was terminated for reason: {shutdown,{error,closed}}

Also, change the lager:info() message when the handoff receiver
gets a tcp_error message that *includes* the reason and
distiguishes itself from other handoff receiver log messages.

Also, one whitespace correction.