basho/riak_core — pull request #642 by jonmeredith (2014-11-06 01:02:01+00:00)
Title: Add optional timeout for handle_handoff_data callback and improve logging

New appenv is app_helper:get_env(riak_core, handoff_receive_vnode_timeout, ?VNODE_TIMEOUT), defaulting to the original 60s timeout. Timeouts are read at the start of each individual handoff.

If the timeout is hit, responds with a cleaner error explaining it was the vnode timeout, how long the timeout is configured for, the size of the handoff data
(to look for smoking large object guns) and the first 128 bytes so a brave soul has a chance of digging out the key.

Do not want to decipher it as do not want to break layering abstraction with riak_kv.

Example when timeout overriden to 120s:
```
17:58:06.777 [error] Handoff receiver for partition 22835963083295358096932575511191922182123945984 exited abnormally after processing 0 objects from {"127.0.0.1",56562}: {error,{vnode_timeout,120000,154,<<131,104,2,100,0,10,101,110,99,111,100,101,95,114,97,119,104,3,109,0,0,0,7,115,121,115,116,101,115,116,109,0,0,0,4,0,0,0,123,109,0,0,0,110,53,1,0,0,0,34,131,108,0,0,0,1,104,2,109,0,0,0,8,197,82,177,11,182,77,60,181,104,2,97,1,110,5,0,174,65,207,205,14,106,0,0,0,1,0,0,0,5,1,0,0,0,123,0,0,0,53,0,0,5,135,0,3,149,238,0,1,38,108,22,52,70,102,78,84,120,112,54,107,68,81,102,110,113>>}}
```